| CODENOTIFIER | HelpYou are not signed inSign in |
Project: Google Web Toolkit
Revision: 3556
Author: jlabanca@google.com
Date: 22 Aug 2008 11:33:41
Changes:Fixes a bug in Window where the __gwt_initWindowHandler function was being obfuscated before it was added to the outer window. This patch sets the name after the obfuscation occurs to ensure it is correct.
Patch by: jlabanca
Review by: jgw
| ... | ...@@ -584,7 +584,7 @@ | |
| 584 | 584 | * string representation of the function that has the syntax of the function. |
| 585 | 585 | */ |
| 586 | 586 | private static native String getInitHandlerMethodString() /*-{ |
| 587 | return function __gwt_initWindowHandlers(resize, scroll, beforeunload, unload) { | |
| 587 | return function(resize, scroll, beforeunload, unload) { | |
| 588 | 588 | var wnd = window |
| 589 | 589 | , oldOnResize = wnd.onresize |
| 590 | 590 | , oldOnBeforeUnload = wnd.onbeforeunload |
| ... | ...@@ -662,9 +662,13 @@ | |
| 662 | 662 | |
| 663 | 663 | private static void maybeInitializeHandlers() { |
| 664 | 664 | if (GWT.isClient() && !handlersAreInitialized) { |
| 665 | handlersAreInitialized = true; | |
| 666 | ||
| 665 | 667 | // Embed the init script on the page |
| 666 | 668 | ScriptElement scriptElem = Document.get().createScriptElement(); |
| 667 | scriptElem.setText(getInitHandlerMethodString()); | |
| 669 | String initFunc = getInitHandlerMethodString().replaceFirst("function", | |
| 670 | "function __gwt_initWindowHandlers"); | |
| 671 | scriptElem.setText(initFunc); | |
| 668 | 672 | Document.get().getBody().appendChild(scriptElem); |
| 669 | 673 | |
| 670 | 674 | // Initialize the handlers |
| ... | ...@@ -672,7 +676,6 @@ | |
| 672 | 676 | |
| 673 | 677 | // Remove the init script from the page |
| 674 | 678 | RootPanel.getBodyElement().removeChild(scriptElem); |
| 675 | handlersAreInitialized = true; | |
| 676 | 679 | } |
| 677 | 680 | } |
| 678 | 681 |