mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
fix table limit
This commit is contained in:
parent
6fbe43a444
commit
00072a9bc3
@ -5,7 +5,7 @@ let initModal = function () {
|
||||
let loading = '<div class="modal-loading"><div class="active loader large"></div></div>';
|
||||
|
||||
// Loading state
|
||||
modal.on('loading', function() {
|
||||
modal.on('loading', function () {
|
||||
$(this).find('.modal-content').append(loading);
|
||||
});
|
||||
|
||||
@ -36,6 +36,25 @@ let initModal = function () {
|
||||
});
|
||||
});
|
||||
|
||||
// Remove onchange event in ajax select field
|
||||
if ($('.table--ajax').find('.table-limit').length > 0) {
|
||||
$('.table--ajax').find('.table-limit').removeAttr("onchange");
|
||||
}
|
||||
|
||||
// Handle ajax select in modals.
|
||||
$('.table--ajax .table-limit').on('change', function (e) {
|
||||
|
||||
e.preventDefault();
|
||||
|
||||
let wrapper = $(this).closest('.modal-content');
|
||||
|
||||
wrapper.append(loading);
|
||||
|
||||
$.get($(this).val(), function (html) {
|
||||
wrapper.html(html);
|
||||
});
|
||||
});
|
||||
|
||||
// Handle ajax forms in modals.
|
||||
modal.on('submit', 'form.ajax', function (e) {
|
||||
|
||||
@ -79,7 +98,7 @@ $(document).ajaxComplete(function () {
|
||||
$(document).on('show.bs.modal', '.modal', function () {
|
||||
let zIndex = 1040 + (10 * $('.modal:visible').length);
|
||||
$(this).css('z-index', zIndex);
|
||||
setTimeout(function() {
|
||||
setTimeout(function () {
|
||||
$('.modal-backdrop').not('.modal-stack').css('z-index', zIndex - 1).addClass('modal-stack');
|
||||
}, 0);
|
||||
});
|
||||
|
||||
Loading…
Reference in New Issue
Block a user