]> git.joonet.de Git - adminer.git/commitdiff
No AJAX for # links
authorJakub Vrana <jakub@vrana.cz>
Mon, 25 Apr 2011 19:06:42 +0000 (21:06 +0200)
committerJakub Vrana <jakub@vrana.cz>
Thu, 5 May 2011 05:10:09 +0000 (07:10 +0200)
adminer/static/functions.js

index 85253a7a17d7192d6e700e70b8e4d2658032ff5e..08a29b9af01267d423206af082abf16e250ef636 100644 (file)
@@ -374,12 +374,12 @@ function ajaxSend(url, data, popState) {
 * @param PopStateEvent|history
 */
 onpopstate = function (event) {
-       if (ajaxState || event.state) {
+       if ((ajaxState || event.state) && !/#/.test(location.href)) {
                ajaxSend(location.href, (event.state && confirm(areYouSure) ? event.state : ''), 1); // 1 - disable pushState
        } else {
                ajaxState++;
        }
-}
+};
 
 /** Send form by AJAX GET
 * @param HTMLFormElement
@@ -480,7 +480,7 @@ function bodyClick(event, db, ns) {
        if (/^a$/i.test(el.parentNode.tagName)) {
                el = el.parentNode;
        }
-       if (/^a$/i.test(el.tagName) && !/^:|#|&download=/i.test(el.getAttribute('href')) && /[&?]username=/.test(el.href)) {
+       if (/^a$/i.test(el.tagName) && !/:|#|&download=/i.test(el.getAttribute('href')) && /[&?]username=/.test(el.href)) {
                var match = /&db=([^&]*)/.exec(el.href);
                var match2 = /&ns=([^&]*)/.exec(el.href);
                return !(db == (match ? match[1] : '') && ns == (match2 ? match2[1] : '') && ajaxSend(el.href));