Sha256: 2d5cfeb344509947288a852687070844d7a33e435fdfc8520aea32234b0b0995
Contents?: true
Size: 684 Bytes
Versions: 4
Compression:
Stored size: 684 Bytes
Contents
// = require_self /** * When switching tabs in i18n fields, autofocus on the input to save clicks #212 */ $(document).on('turbolinks:load', () => { // Event launched by foundation $('[data-tabs]').on('change.zf.tabs', (event) => { const $container = $(event.target).next('.tabs-content .tabs-panel.is-active'); // Detect quilljs editor inside the tabs-panel let $content = $container.find('.editor .ql-editor'); 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
4 entries across 4 versions & 2 rubygems