]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 577574: Make YUI's unload listener into a "pagehide" listener on
authorGuy Pyrzak <guy.pyrzak@gmail.com>
Sun, 29 Aug 2010 21:24:11 +0000 (14:24 -0700)
committerMax Kanat-Alexander <mkanat@bugzilla.org>
Sun, 29 Aug 2010 21:24:11 +0000 (14:24 -0700)
browsers that support it. Before this patch, fields using YUI autocomplete
were losing their entered data when pressing "Back" in the browser
r=mkanat, a=mkanat

template/en/default/global/header.html.tmpl

index f76fdd59f51ca33aa8dbc646482aee5895dfe983..e6764ed2bf463e4afa4440b8d471e455ec2818c2 100644 (file)
     <script type="text/javascript">
     <!--
         YAHOO.namespace('bugzilla');
-        if (YAHOO.env.ua.gecko) {
+        
+        if ( "onpagehide" in window || YAHOO.env.ua.gecko) {
             YAHOO.util.Event._simpleRemove(window, "unload", 
                                            YAHOO.util.Event._unload);
+            YAHOO.util.Event._simpleAdd(window, "pagehide", 
+                                           YAHOO.util.Event._unload);
         }
         [%# The language selector needs javascript to set its cookie,
           # so it is hidden in HTML/CSS by the "bz_default_hidden" class.