Author: knopp
Date: Wed Jan 17 15:15:04 2007
New Revision: 497235
URL: http://svn.apache.org/viewvc?view=rev&rev=497235
Log:
Modal window fix
Modified:
incubator/wicket/branches/wicket-1.2.x/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/res/modal.js
Modified:
incubator/wicket/branches/wicket-1.2.x/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/res/modal.js
URL:
http://svn.apache.org/viewvc/incubator/wicket/branches/wicket-1.2.x/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/res/modal.js?view=diff&rev=497235&r1=497234&r2=497235
==============================================================================
---
incubator/wicket/branches/wicket-1.2.x/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/res/modal.js
(original)
+++
incubator/wicket/branches/wicket-1.2.x/wicket-extensions/src/main/java/wicket/extensions/ajax/markup/html/modal/res/modal.js
Wed Jan 17 15:15:04 2007
@@ -311,6 +311,11 @@
Wicket.Window = Class.create();
/**
+ * Display confirmation dialog if the user is about to leave a page (IE and
FF).
+ */
+Wicket.Window.unloadConfirmation = true;
+
+/**
* Creates a wicket window instance. The advantage of using this is
* that in case an iframe modal window is opened in an already displayed
* iframe modal window, the new window is created as a top-level window.
@@ -771,10 +776,12 @@
// preserve old beforeunload handler
this.old_onbeforeunload = window.onbeforeunload;
- // new beforeunload handler - ask user before reloading window
- window.onbeforeunload = function() {
- return "Reloading this page will cause the modal window
disappear.";
- }
+ if (Wicket.Window.unloadConfirmation == true) {
+ // new beforeunload handler - ask user before reloading
window
+ window.onbeforeunload = function() {
+ return "Reloading this page will cause the
modal window disappear.";
+ }
+ }
// create the mask that covers the background