mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 15:40:31 +08:00
21 lines
605 B
JavaScript
21 lines
605 B
JavaScript
(function() {
|
|
'use strict';
|
|
|
|
function initRemoteModalListeners() {
|
|
$(document).on('click', 'a[data-action="remote-modal"]', function(ev) {
|
|
ev.stopImmediatePropagation();
|
|
ev.stopPropagation();
|
|
ev.preventDefault();
|
|
|
|
animateSpinner();
|
|
$.get(ev.currentTarget.getAttribute('href')).then(function({ modal }) {
|
|
$(modal).on('shown.bs.modal', function() {
|
|
$(this).find('.selectpicker').selectpicker();
|
|
}).modal('show');
|
|
animateSpinner(null, false);
|
|
});
|
|
});
|
|
}
|
|
|
|
$(document).one('turbolinks:load', initRemoteModalListeners);
|
|
}());
|