Sha256: bdd32aa0dbf7afecf1e58712b7514c59eed51adadc0557c22cda3c0f1d5b558e
Contents?: true
Size: 654 Bytes
Versions: 13
Compression:
Stored size: 654 Bytes
Contents
/** * When switching tabs in i18n fields, autofocus on the input to save clicks #212 */ $(() => { // Event launched by foundation $("[data-tabs]").on("change.zf.tabs", (event) => { const $container = $(event.target).parent().next(".tabs-content").find(".tabs-panel.is-active"); // Detect rich text editor inside the tabs-panel let $content = $container.find(".editor .ProseMirror"); if ($content.length > 0) { $content.focus(); // Detect if inside the tabs-panel have an input } else { $content = $container.find("input:first"); if ($content.length > 0) { $content.focus(); } } }); });
Version data entries
13 entries across 13 versions & 1 rubygems