Sha256: 43105cf3b4e0f4f9bf2effba21049bc0019c96f7fcd5ed89a7ba2555296cf74d

Contents?: true

Size: 840 Bytes

Versions: 9

Compression:

Stored size: 840 Bytes

Contents

/**
 * When switching tabs in i18n fields, autofocus on the markdown if exists
 */
$(() => {
  // Event launched by foundation
  $("[data-tabs]").on("change.zf.tabs", (event) => {
    const $container = $(event.target).closest(".label--tabs").next(".tabs-content").find(".tabs-panel.is-active");
    // fix inscrybmde if present
    let $input = $container.find('[name="faker-inscrybmde"]');
    if ($input.length > 0) {
      $input[0].InscrybMDE.codemirror.refresh();
    }
    // fix custom fields if present
    $input = $container.find(".proposal_custom_field:first");
    if ($input.length > 0) {
      // saves current data to the hidden field for the lang
      window.DecidimAwesome.CustomFieldsRenderer.storeData();
      // init the current language
      window.DecidimAwesome.CustomFieldsRenderer.init($input);
    }
  });
});

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
decidim-decidim_awesome-0.10.2 app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js
decidim-decidim_awesome-0.10.1 app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js
decidim-decidim_awesome-0.10.0 app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js
decidim-decidim_awesome-0.9.3 app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js
decidim-decidim_awesome-0.9.1 app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js
decidim-decidim_awesome-0.8.3 app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js
decidim-decidim_awesome-0.8.2 app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js
decidim-decidim_awesome-0.8.1 app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js
decidim-decidim_awesome-0.8.0 app/packs/src/decidim/decidim_awesome/editors/tabs_focus.js