From ffa100d5acacebc42c376e2d95a3b6f4ecc616fe Mon Sep 17 00:00:00 2001 From: Silvio Date: Tue, 30 Apr 2013 18:23:29 -0300 Subject: Stateful showOverlay() --- gmap_arcgis.js | 66 ++++++++++++++++++++++++++++++++-------------------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/gmap_arcgis.js b/gmap_arcgis.js index 76142ad..289331f 100644 --- a/gmap_arcgis.js +++ b/gmap_arcgis.js @@ -32,12 +32,45 @@ function gmapArcgis(config) { // UI unblocker wrapper unblockUI: function() { - jQuery.unblockUI(); + if (this.config.ui == undefined || this.config.ui == 'blocked') { + jQuery.unblockUI(); + this.config.ui = 'unblocked'; + } }, // UI blocker wrapper - blockUI: function() { - jQuery.blockUI(); + blockUI: function(params) { + if (this.config.ui == undefined || this.config.ui == 'unblocked') { + jQuery.blockUI(params); + this.config.ui = 'blocked'; + } + }, + + // Block the UI and show an overlay + showOverlay: function(t) { + if ($.browser.msie === false || $.browser.msie === undefined) { + message = this.config.overlayMessage; + + if (this.config.overlayCss != undefined) { + css = this.config.overlayCss; + } + else { + css = { }; + } + + if (t == false) { + this.blockUI({ + message: message, + css: css, + }); + } else { + this.blockUI({ + message: message, + css: css, + timeout: t, + }); + } + } }, // Count object properties @@ -345,33 +378,6 @@ function gmapArcgis(config) { } }, - // Block the UI and show an overlay - showOverlay: function(t) { - if ($.browser.msie === false || $.browser.msie === undefined) { - message = this.config.overlayMessage; - - if (this.config.overlayCss != undefined) { - css = this.config.overlayCss; - } - else { - css = { }; - } - - if (t == false) { - $.blockUI({ - message: message, - css: css, - }); - } else { - $.blockUI({ - message: message, - css: css, - timeout: t, - }); - } - } - }, - // Change a element in the map changeElement: function(type, element, callback) { if (this.config[type][element] == undefined || this.config[type][element]['showOn'] == undefined) { -- cgit v1.2.3