(bug 8622) Clean up check for whether watch checkbox exists. Thanks to Brion for...
authorAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 14 Jan 2007 02:30:26 +0000 (02:30 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Sun, 14 Jan 2007 02:30:26 +0000 (02:30 +0000)
skins/common/wikibits.js

index f466940..0ed1922 100644 (file)
@@ -596,6 +596,7 @@ function akeytt( doId ) {
        }
 
        // Now deal with evil deprecated ta
+       watchCheckboxExists = getElementById( 'wpWatchthis' ) ? true : false;
        for (var id in ta) {
                var n = document.getElementById(id);
                if (n) {
@@ -612,8 +613,7 @@ function akeytt( doId ) {
                                }
                                // Don't add an accesskey for the watch tab if the watch
                                // checkbox is also available.
-                               if (a && ((id != 'ca-watch' && id != 'ca-unwatch') ||
-                               !(window.location.search.match(/[\?&](action=edit|action=submit)/i)))) {
+                               if (a && ((id != 'ca-watch' && id != 'ca-unwatch') || !watchCheckboxExists)) {
                                        a.accessKey = ta[id][0];
                                        ak = ' ['+tooltipAccessKeyPrefix+ta[id][0]+']';
                                }