Fixed hotkey menu option selection issues on Chrome.
authorJanusz Dobrowolski <janusz@frontaccouting.eu>
Fri, 19 Apr 2013 13:36:26 +0000 (15:36 +0200)
committerJanusz Dobrowolski <janusz@frontaccouting.eu>
Fri, 19 Apr 2013 13:36:26 +0000 (15:36 +0200)
js/inserts.js
js/utils.js

index ca55cfa110e8e592c102e939abbd138d6f384005..2e14ebf4d75df58657fa68262b885a2e5c8c5f5b 100644 (file)
@@ -454,7 +454,8 @@ var inserts = {
                                        ev.returnValue = false;
                                        return false;
                                }
-                               window.location = e.href;
+                               if (!_hotkeys.alt)      // ommit chrome Chrome accesskeys 
+                                       window.location = e.href;
                        }
        },
        'ul.ajaxtabs':  function(ul) {
@@ -465,7 +466,8 @@ var inserts = {
 // ?  var modifiedurl=ulistlink.getAttribute("href").replace(/^http:\/\/[^\/]+\//i, "http://"+window.location.hostname+"/")
                    var url = tab.form.action
                    tab.onclick=function(){
-                       _expand(this);
+                   if (!_hotkeys.alt)
+                               _expand(this);
                        return false;
                    }
                }
@@ -538,7 +540,7 @@ function setHotKeys() {
                        for (var i=0; i<cnt; i++) { 
                                n = (n+1)%cnt;
                                // check also if the link is visible
-                               if (l[n].accessKey==key && l[n].scrollWidth) {
+                               if (l[n].accessKey==key && (l[n].offsetWidth || l[n].offsetHeight)) {
                                        _hotkeys.focus = n;
            // The timeout is needed to prevent unpredictable behaviour on IE.
                                        var tmp = function() {l[_hotkeys.focus].focus();};
index 761378e4c4ddcf22df2f371d7414ae50559616be..6eee606bf7acb4d8bfca3e1d2f0f1d2b0c09b9da 100644 (file)
@@ -58,6 +58,8 @@ JsHttpRequest._request = function(trigger, form, tout, retry) {
                var url = form ? form.action : 
                  window.location.toString();
 
+               if (!form) form = document.forms[0]; // when trigger element is on already superseded page fragment, form is null
+
                var content = this.formInputs(trigger, form, upload);
 
                if (!form) url = url.substring(0, url.indexOf('?'));