Sha256: 738498cbeaa457c16948d24b292c6686baf0c01bc7242efd4272875b101097db

Contents?: true

Size: 454 Bytes

Versions: 6

Compression:

Stored size: 454 Bytes

Contents

import { initSelect2 } from '../common/common.js';

$(document).on('turbolinks:load', () => {
  $('select.select2').each(function(_i, ele) {
    initSelect2(ele);
  })
})

$(document).on('turbolinks:before-cache', () => {
  $('select.select2').select2('destroy');
  destroyDataTables();
})

function destroyDataTables() {
  let $dts = $('.dataTable');
  if ($dts.length) {
    $dts.each(function(_i, dt) {
      $(dt).DataTable().destroy();
    })
  }
}

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
rails_material_admin-0.1.9 vendor/javascript/src/javascripts/admin/common/scaffold.js
rails_material_admin-0.1.8 vendor/javascript/src/javascripts/admin/common/scaffold.js
rails_material_admin-0.1.7 vendor/javascript/src/javascripts/admin/common/scaffold.js
rails_material_admin-0.1.6 vendor/javascript/src/javascripts/admin/common/scaffold.js
rails_material_admin-0.1.5 vendor/javascript/src/javascripts/admin/common/scaffold.js
rails_material_admin-0.1.4 vendor/javascript/src/javascripts/admin/common/scaffold.js