manager: use ajax to refresh tables using search button (#60118)
This commit is contained in:
parent
a33834b613
commit
b79f165c4a
|
@ -142,19 +142,18 @@
|
|||
return false;
|
||||
});
|
||||
/* confirmation on submit buttons */
|
||||
$(document).on('click', 'button', function (e) {
|
||||
if ($(e.target).data('confirm')) {
|
||||
if (! confirm($(e.target).data('confirm'))) {
|
||||
e.preventDefault();
|
||||
return false;
|
||||
}
|
||||
} else if ($(e.target).data('url')) {
|
||||
$(document).on('click', 'button[data-confirm]', function (e) {
|
||||
if (! confirm($(e.target).data('confirm'))) {
|
||||
e.preventDefault();
|
||||
if ($(e.target).attr('rel') == 'popup') {
|
||||
return displayPopup.apply($(e.target), [e]);
|
||||
} else {
|
||||
window.location.href = $(e.target).data('url');
|
||||
}
|
||||
return false;
|
||||
}
|
||||
});
|
||||
$(document).on('click', 'button[data-url]', function (e) {
|
||||
e.preventDefault();
|
||||
if ($(e.target).attr('rel') == 'popup') {
|
||||
return displayPopup.apply($(e.target), [e]);
|
||||
} else {
|
||||
window.location.href = $(e.target).data('url');
|
||||
}
|
||||
});
|
||||
$(document).on('change', '#id_generate_password', function (e) {
|
||||
|
@ -197,6 +196,21 @@
|
|||
}, 600);
|
||||
|
||||
});
|
||||
$('#search-form button').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
$('#search-form').trigger('submit');
|
||||
return false;
|
||||
});
|
||||
$('#search-form').on('submit', function(e) {
|
||||
var $form = $('#search-form');
|
||||
if (timer) {
|
||||
window.clearTimeout(timer);
|
||||
timer = null;
|
||||
}
|
||||
var query = $form.serialize();
|
||||
update_content('?' + query, {'form': '#search-form', 'values': $form.values()}, true);
|
||||
return false;
|
||||
});
|
||||
if ($('#search-form').length) {
|
||||
window.history.replaceState({'form': '#search-form', 'values': $('#search-form').values()}, window.document.title, window.location.href)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue