Add AJAX workers only for the static links.

Signed-off-by: Eric Riggs <ericriggs42@gmail.com>
This commit is contained in:
Eric Riggs
2018-03-08 20:05:11 -04:00
committed by Roberto Rosario
parent c267933fb8
commit 67b940aec9
2 changed files with 17 additions and 17 deletions

View File

@@ -10,13 +10,13 @@ var partialNavigation = new PartialNavigation({
jQuery(document).ready(function() {
app.setupFullHeightResizing();
app.setupNavbarCollapse();
app.setupAJAXperiodicWorkers();
partialNavigation.initialize();
});
var afterBaseLoad = function () {
MayanImage.intialize();
app.doToastrMessages();
app.setupAJAXperiodicWorkers();
app.setupAutoSubmit();
app.setupItemsSelector();
app.setupNewWindowAnchor();

View File

@@ -104,22 +104,6 @@ App.prototype.AJAXperiodicWorker = function (options) {
});
}
App.prototype.setupAJAXperiodicWorkers = function () {
var app = this;
$('a[data-apw-url]').each(function() {
var $this = $(this);
app.AJAXperiodicWorker({
attributeName: $this.data('apw-attribute'),
APIURL: $this.data('apw-url'),
callback: $this.data('apw-callback'),
element: $this,
interval: $this.data('apw-interval'),
});
});
}
App.prototype.doToastrMessages = function () {
toastr.options = {
'closeButton': true,
@@ -186,6 +170,22 @@ App.prototype.doToastrMessages = function () {
});
}
App.prototype.setupAJAXperiodicWorkers = function () {
var app = this;
$('a[data-apw-url]').each(function() {
var $this = $(this);
app.AJAXperiodicWorker({
attributeName: $this.data('apw-attribute'),
APIURL: $this.data('apw-url'),
callback: $this.data('apw-callback'),
element: $this,
interval: $this.data('apw-interval'),
});
});
}
App.prototype.setupAutoSubmit = function () {
$('.select-auto-submit').change(function () {
if ($(this).val()) {