Add AJAX workers only for the static links.
Signed-off-by: Eric Riggs <ericriggs42@gmail.com>
This commit is contained in:
committed by
Roberto Rosario
parent
c267933fb8
commit
67b940aec9
@@ -10,13 +10,13 @@ var partialNavigation = new PartialNavigation({
|
|||||||
jQuery(document).ready(function() {
|
jQuery(document).ready(function() {
|
||||||
app.setupFullHeightResizing();
|
app.setupFullHeightResizing();
|
||||||
app.setupNavbarCollapse();
|
app.setupNavbarCollapse();
|
||||||
|
app.setupAJAXperiodicWorkers();
|
||||||
partialNavigation.initialize();
|
partialNavigation.initialize();
|
||||||
});
|
});
|
||||||
|
|
||||||
var afterBaseLoad = function () {
|
var afterBaseLoad = function () {
|
||||||
MayanImage.intialize();
|
MayanImage.intialize();
|
||||||
app.doToastrMessages();
|
app.doToastrMessages();
|
||||||
app.setupAJAXperiodicWorkers();
|
|
||||||
app.setupAutoSubmit();
|
app.setupAutoSubmit();
|
||||||
app.setupItemsSelector();
|
app.setupItemsSelector();
|
||||||
app.setupNewWindowAnchor();
|
app.setupNewWindowAnchor();
|
||||||
|
|||||||
@@ -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 () {
|
App.prototype.doToastrMessages = function () {
|
||||||
toastr.options = {
|
toastr.options = {
|
||||||
'closeButton': true,
|
'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 () {
|
App.prototype.setupAutoSubmit = function () {
|
||||||
$('.select-auto-submit').change(function () {
|
$('.select-auto-submit').change(function () {
|
||||||
if ($(this).val()) {
|
if ($(this).val()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user