From 1cb3f9fe60321e6671af9e4689cd54bdf2218ee9 Mon Sep 17 00:00:00 2001 From: Roberto Rosario Date: Fri, 22 Feb 2019 04:00:33 -0400 Subject: [PATCH] Remove AJAX workers Specified in ef415ef8265f8bc835533d8683f0dfb456508534. Signed-off-by: Roberto Rosario --- .../static/appearance/js/mayan_app.js | 69 ------------------- 1 file changed, 69 deletions(-) diff --git a/mayan/apps/appearance/static/appearance/js/mayan_app.js b/mayan/apps/appearance/static/appearance/js/mayan_app.js index b3df0c8e14..967a3a62f9 100644 --- a/mayan/apps/appearance/static/appearance/js/mayan_app.js +++ b/mayan/apps/appearance/static/appearance/js/mayan_app.js @@ -29,29 +29,6 @@ class MayanApp { } } - static mayanNotificationBadge (options, data) { - // Callback to add the notifications count inside a badge markup - var notifications = data[options.attributeName]; - - if (notifications > 0) { - // Save the original link text before adding the initial badge markup - if (!options.element.data('mn-saved-text')) { - options.element.data('mn-saved-text', options.element.html()); - } - - options.element.html( - options.element.data('mn-saved-text') + ' ' + notifications + '' - ); - } else { - if (options.element.data('mn-saved-text')) { - // If there is a saved original link text, restore it - options.element.html( - options.element.data('mn-saved-text') - ); - } - } - } - static setupMultiItemActions () { $('body').on('change', '.check-all-slave', function () { MayanApp.countChecked(); @@ -94,35 +71,6 @@ class MayanApp { // Instance methods - AJAXperiodicWorker (options) { - var app = this; - - $.ajax({ - complete: function() { - if (!options.app) { - // Preserve the app reference between consecutive calls - options.app = app; - } - setTimeout(options.app.AJAXperiodicWorker, options.interval, options); - }, - success: function(data) { - if (options.callback) { - // Convert the callback string to an actual function - var callbackFunction = window; - - $.each(options.callback.split('.'), function (index, value) { - callbackFunction = callbackFunction[value] - }); - - callbackFunction(options, data); - } else { - options.element.text(data[options.attributeName]); - } - }, - url: options.APIURL - }); - } - callbackAJAXSpinnerUpdate () { if (this.ajaxExecuting) { $(this.ajaxSpinnerSeletor).fadeIn(50); @@ -223,7 +171,6 @@ class MayanApp { initialize () { var self = this; - this.setupAJAXPeriodicWorkers(); this.setupAJAXSpinner(); this.setupFormHotkeys(); this.setupFullHeightResizing(); @@ -240,22 +187,6 @@ class MayanApp { partialNavigation.initialize(); } - setupAJAXPeriodicWorkers () { - 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'), - }); - }); - } - setupAJAXSpinner () { var self = this;