From 67b940aec9ab07b293fe6c07e91aec4aeb098be2 Mon Sep 17 00:00:00 2001 From: Eric Riggs Date: Thu, 8 Mar 2018 20:05:11 -0400 Subject: [PATCH] Add AJAX workers only for the static links. Signed-off-by: Eric Riggs --- .../appearance/static/appearance/js/base.js | 2 +- .../static/appearance/js/mayan_app.js | 32 +++++++++---------- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/mayan/apps/appearance/static/appearance/js/base.js b/mayan/apps/appearance/static/appearance/js/base.js index 0d66318699..79c7a7468c 100644 --- a/mayan/apps/appearance/static/appearance/js/base.js +++ b/mayan/apps/appearance/static/appearance/js/base.js @@ -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(); diff --git a/mayan/apps/appearance/static/appearance/js/mayan_app.js b/mayan/apps/appearance/static/appearance/js/mayan_app.js index 15325fa20b..94e2045d30 100644 --- a/mayan/apps/appearance/static/appearance/js/mayan_app.js +++ b/mayan/apps/appearance/static/appearance/js/mayan_app.js @@ -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()) {