Hey everyone,
We would like to make a modal box optionally come up in the
'deactivate' state when launched.
This is so it can be used to show something like a progress bar, that
can't be escaped out of, or closed.
The reason I would like this to happen on launch, is that the modalBox
window in our example doesn't have any user interaction (ie no
buttons, etc.) so calling the deactivate() function manually is not
really an option.
I have made the modifications myself and they work really well, I'm
hoping to get them added in a future version.
Basically, I added a 'deactivateOnLaunch' to options (default false).
if it is set to true, then in show(), I call deactivate().
Here are the changes I have made.
Index: Shared/WebServerResources/js/modalbox.js
===================================================================
--- Shared/WebServerResources/js/modalbox.js (revision 10936)
+++ Shared/WebServerResources/js/modalbox.js (working copy)
@@ -35,7 +35,8 @@
params: {},
method: 'get', // Default Ajax request method
autoFocusing: true, // Toggles auto-focusing for form elements.
Disable for long text pages.
- aspnet: false // Should be use then using with
ASP.NET costrols.
Then true Modalbox window will be injected into the first form
element.
+ aspnet: false, // Should be use then using with
ASP.NET costrols.
Then true Modalbox window will be injected into the first form
element.
+ deactivateOnLaunch: false //If the ModalBox is 'deactive' when
launched.
},
_options: new Object,
@@ -106,6 +107,9 @@
this._update();
this.event("onUpdate"); // Passing onUpdate callback
}
+
+ if(this.options.deactivateOnLaunch)
+ this.deactivate(options);
},
hide: function(options) { // External hide method to use from
external HTML and JS
Thanks very much,
-Dan