Sha256: 0c15bb64895e2f491e3613af2107e1bf95c9bf644896ca1828907b1d05948cff

Contents?: true

Size: 1.36 KB

Versions: 18

Compression:

Stored size: 1.36 KB

Contents

import jQuery from 'jquery';
window.jQuery = jQuery // <- "select2" will check this
window.$ = jQuery

// This is a hack to fix 'process is not defined'
// Ref article: https://adambien.blog/roller/abien/entry/uncaught_referenceerror_process_is_not
// Based on this filter dropdown works.
window.process = {
  env: {
      NODE_ENV: 'development'
  }
} 

import 'moment'
import 'bootstrap'
import '@popperjs/core'
import 'flatpickr'
import 'jgrowl'
import Select2 from "select2"
Select2()

// import '@nathanvda/cocoon'
import 'daterangepicker'
import '@fortawesome/fontawesome-free'
import jqueryJgrowl from 'jgrowl';


document.addEventListener("turbo:load", function () {
  flatpickr("[data-behaviour='date-only']", {
    dateFormat: "d-m-Y"
  })
  flatpickr("[data-behaviour='date-time']", {
    enableTime: true
  })
  flatpickr("[data-behaviour='filter'][data-filter-type='date']", {
    mode: 'range'
  })
  $('.select-2').select2({
    theme: "bootstrap-5",
  });
  jqueryJgrowl()
});

$(document).on('click', '.menu-item', function(e) {
  $('.profile-popup').toggleClass('hidden');
});

$(document).on('click', '.destroy-attachment', function(e) {
  var ar_id = $(this).data('ar-id')
  $(this).addClass('hidden')
  $(this).append('<input type="text" name="attachment_destroy_ids[]" value="' + ar_id + '"/>')
})

window.addEventListener('popstate', e => window.location.reload() );

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
cm-admin-1.4.6 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.4.4 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.4.3 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.4.2 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.4.1 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.4.0 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.3.9 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.3.8 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.3.7 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.3.6 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.3.5 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.3.4 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.3.3 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.3.2 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.3.1 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.3.0 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.2.9 app/assets/javascripts/cm_admin/scaffolds.js
cm-admin-1.2.8 app/assets/javascripts/cm_admin/scaffolds.js