2021-05-22 20:41:56 +08:00
|
|
|
(function() {
|
2021-04-18 23:19:16 +08:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
function initRemoteModalListeners() {
|
2021-04-25 00:43:28 +08:00
|
|
|
$(document).on('click', 'a[data-action="remote-modal"]', function(ev) {
|
|
|
|
ev.stopImmediatePropagation();
|
|
|
|
ev.stopPropagation();
|
|
|
|
ev.preventDefault();
|
2021-05-08 16:05:22 +08:00
|
|
|
|
|
|
|
animateSpinner();
|
2021-05-22 20:41:56 +08:00
|
|
|
$.get(ev.currentTarget.getAttribute('href')).then(function({ modal }) {
|
2021-05-30 01:25:46 +08:00
|
|
|
$(modal).on('shown.bs.modal', function() {
|
|
|
|
$(this).find('.selectpicker').selectpicker();
|
2021-05-22 20:41:56 +08:00
|
|
|
}).modal('show');
|
2021-05-08 16:05:22 +08:00
|
|
|
animateSpinner(null, false);
|
2021-05-02 17:36:10 +08:00
|
|
|
});
|
|
|
|
});
|
2021-04-18 23:19:16 +08:00
|
|
|
}
|
|
|
|
|
2021-04-25 00:43:28 +08:00
|
|
|
$(document).one('turbolinks:load', initRemoteModalListeners);
|
2021-05-02 17:36:10 +08:00
|
|
|
}());
|