Sha256: 33542de5e9fa07a9ac8e5efa1856bedd0e771a7f3df3728e186f17ae858d129d

Contents?: true

Size: 1.08 KB

Versions: 16

Compression:

Stored size: 1.08 KB

Contents

// = require jquery
// = require jquery_ujs
// = require foundation
// = require ./tab_focus
// = require ./toggle_nav
// = require ./sort_list.component
// = require decidim/editor
// = require foundation-datepicker
// = require form_datepicker
// = require moment.min
// = require_self

window.Decidim = window.Decidim || {};

const pageLoad = () => {
  const { toggleNav, createSortList } = window.DecidimAdmin;

  $(document).foundation();

  toggleNav();

  createSortList('#steps tbody', {
    placeholder: $('<tr style="border-style: dashed; border-color: #000"><td colspan="4">&nbsp;</td></tr>')[0],
    onSortUpdate: ($children) => {
      const sortUrl = $('#steps tbody').data('sort-url')
      const order = $children.map((index, child) => $(child).data('id')).toArray();

      $.ajax({
        method: 'POST',
        url: sortUrl,
        contentType: 'application/json',
        data: JSON.stringify({ items_ids: order }) }, // eslint-disable-line camelcase
      );
    }
  })
};

$(() => {
  pageLoad();

  if (window.Decidim.formDatePicker) {
    window.Decidim.formDatePicker();
  }
});

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
decidim-admin-0.4.4 app/assets/javascripts/decidim/admin/application.js.es6
decidim-0.4.4 decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6
decidim-admin-0.4.3 app/assets/javascripts/decidim/admin/application.js.es6
decidim-admin-0.4.2 app/assets/javascripts/decidim/admin/application.js.es6
decidim-admin-0.4.1 app/assets/javascripts/decidim/admin/application.js.es6
decidim-0.4.3 decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6
decidim-0.4.2 decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6
decidim-0.4.1 decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6
decidim-admin-0.4.0 app/assets/javascripts/decidim/admin/application.js.es6
decidim-0.4.0 decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6
decidim-admin-0.3.2 app/assets/javascripts/decidim/admin/application.js.es6
decidim-0.3.2 decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6
decidim-admin-0.3.1 app/assets/javascripts/decidim/admin/application.js.es6
decidim-0.3.1 decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6
decidim-admin-0.3.0 app/assets/javascripts/decidim/admin/application.js.es6
decidim-0.3.0 decidim-admin/app/assets/javascripts/decidim/admin/application.js.es6