diff options
author | Kris Maglione <maglione.k@gmail.com> | 2011-01-05 14:42:39 -0500 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2011-01-05 14:42:39 -0500 |
commit | 20d978bf6319f7f2019fba9ab7159f631835fc43 (patch) | |
tree | 5f4f17beb77683bb0aebaca3af12b162bd27e04d /common | |
parent | 557e8fc0c191420750962ddc91fd8ecf727be1e0 (diff) | |
download | pentadactyl-20d978bf6319f7f2019fba9ab7159f631835fc43.tar.gz |
Try not to reset dactylFocusAllowed on hash tag change. Closes issue #237.
Diffstat (limited to 'common')
-rw-r--r-- | common/content/buffer.js | 14 | ||||
-rw-r--r-- | common/content/events.js | 1 | ||||
-rw-r--r-- | common/modules/util.jsm | 2 |
3 files changed, 13 insertions, 4 deletions
diff --git a/common/content/buffer.js b/common/content/buffer.js index 171e536f..2da48d8e 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -288,9 +288,17 @@ var Buffer = Module("buffer", { onLocationChange: function onLocationChange(webProgress, request, uri) { onLocationChange.superapply(this, arguments); statusline.updateUrl(); - statusline.updateProgress(webProgress.DOMWindow || content); - for (let frame in values(buffer.allFrames(webProgress.DOMWindow || content))) - frame.document.dactylFocusAllowed = false; + if (webProgress.DOMWindow && uri) { + statusline.updateProgress(webProgress.DOMWindow); + + let oldURI = webProgress.document.dactylURI; + if (webProgress.document.dactylLoadIdx === webProgress.loadedTransIndex + || !oldURI || uri.spec.replace(/#.*/, "") !== oldURI.replace(/#.*/, "")) + for (let frame in values(buffer.allFrames(webProgress.DOMWindow))) + frame.document.dactylFocusAllowed = false; + webProgress.document.dactylURI = uri.spec; + webProgress.document.dactylLoadIdx = webProgress.loadedTransIndex; + } // Workaround for bugs 591425 and 606877, dactyl bug #81 let collapse = uri && uri.scheme === "dactyl" && webProgress.isLoadingDocument; diff --git a/common/content/events.js b/common/content/events.js index f61768b4..91959680 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -996,6 +996,7 @@ var Events = Module("events", { onMouseDown: function onMouseDown(event) { let elem = event.target; let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem; + for (; win; win = win != win.parent && win.parent) win.document.dactylFocusAllowed = true; }, diff --git a/common/modules/util.jsm b/common/modules/util.jsm index 8aca002c..b669dd1b 100644 --- a/common/modules/util.jsm +++ b/common/modules/util.jsm @@ -796,7 +796,7 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]), * @returns {nsIURI} */ // FIXME: createURI needed too? - newURI: function (uri, charset, base) services.io.newURI(uri.replace(/.* -> /, ""), charset, base), + newURI: function (uri, charset, base) services.io.newURI(String.replace(uri, /.* -> /, ""), charset, base), /** * Pretty print a JavaScript object. Use HTML markup to color certain items |