60 |
60 |
});
|
61 |
61 |
}
|
62 |
62 |
|
|
63 |
function autorefresh_table() {
|
|
64 |
$(document).trigger('backoffice-filter-change',
|
|
65 |
{qs: $('form#listing-settings').serialize(), auto: true});
|
|
66 |
}
|
|
67 |
|
63 |
68 |
function refresh_table() {
|
64 |
|
$(document).trigger('backoffice-filter-change', $('form#listing-settings').serialize());
|
|
69 |
$(document).trigger('backoffice-filter-change',
|
|
70 |
{qs: $('form#listing-settings').serialize(), auto: false});
|
65 |
71 |
}
|
66 |
72 |
|
67 |
73 |
$(document).on('backoffice-filter-change', function(event, listing_settings) {
|
... | ... | |
69 |
75 |
var pathname = window.location.pathname.replace(/^\/+/, '/');
|
70 |
76 |
|
71 |
77 |
$.ajax({
|
72 |
|
url: pathname + '?ajax=true&' + listing_settings,
|
|
78 |
url: pathname + '?ajax=true&' + listing_settings.qs,
|
73 |
79 |
beforeSend: function() { $('#more-user-links, #listing, #statistics').addClass('activity'); },
|
74 |
80 |
complete: function() { $('#more-user-links, #listing, #statistics').removeClass('activity'); },
|
75 |
81 |
success: function(html) {
|
... | ... | |
83 |
89 |
prepare_row_links();
|
84 |
90 |
prepare_column_headers();
|
85 |
91 |
$('a[data-base-href]').each(function(idx, elem) {
|
86 |
|
$(elem).attr('href', $(elem).data('base-href') + '?' + listing_settings);
|
|
92 |
$(elem).attr('href', $(elem).data('base-href') + '?' + listing_settings.qs);
|
87 |
93 |
});
|
88 |
94 |
if (window.history) {
|
89 |
|
window.history.replaceState(null, null, pathname + '?' + listing_settings);
|
|
95 |
window.history.replaceState(null, null, pathname + '?' + listing_settings.qs);
|
90 |
96 |
}
|
91 |
97 |
/* makes sure activity and disabled-during-submit are removed */
|
92 |
98 |
$('#more-user-links, #listing, #statistics').removeClass('activity');
|
... | ... | |
178 |
184 |
return true;
|
179 |
185 |
}
|
180 |
186 |
event.preventDefault();
|
181 |
|
$(document).trigger('backoffice-filter-change', $('form#listing-settings').serialize());
|
|
187 |
$(document).trigger('backoffice-filter-change', {qs: $('form#listing-settings').serialize()});
|
182 |
188 |
return false;
|
183 |
189 |
});
|
184 |
190 |
|
... | ... | |
186 |
192 |
var idle_id = null;
|
187 |
193 |
$(window).on('mousemove keydown mousedown touchstart', function() {
|
188 |
194 |
if (idle_id) window.clearInterval(idle_id);
|
189 |
|
idle_id = setInterval(refresh_table, 30000);
|
|
195 |
idle_id = setInterval(autorefresh_table, 30000);
|
190 |
196 |
});
|
191 |
197 |
}
|
192 |
198 |
|
193 |
|
-
|