Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

moved MozScrolledAreaChanged event listener to content script

  • Loading branch information...
commit 1b14ac34d2f6555c24bb38b197105feec7fbe0dc 1 parent 650256f
@eeejay authored
Showing with 3 additions and 4 deletions.
  1. +2 −1  content/content-script.js
  2. +1 −3 content/presenter.js
View
3  content/content-script.js
@@ -17,6 +17,7 @@ addEventListener('DOMContentLoaded', Callback(contentLoadedHandler));
addMessageListener("TalkToMe:Navigate", Callback(navigateHandler));
addMessageListener("TalkToMe:Activate", Callback(activateHandler));
addMessageListener("TalkToMe:CurrentBounds", Callback(currentBoundsHandler));
+addEventListener("MozScrolledAreaChanged", Callback(currentBoundsHandler));
function WebProgressListener() {
let flags = Ci.nsIWebProgress.NOTIFY_ALL;
@@ -142,7 +143,7 @@ function activateHandler(message) {
sendAsyncMessage("TalkToMe:Activated");
}
-function currentBoundsHandler(message) {
+function currentBoundsHandler() {
if (!domWalker || !domWalker.currentNode) return;
let bounds = DOMWalker.accToRect(
View
4 content/presenter.js
@@ -117,13 +117,11 @@ function _Highlighter(window) {
if (highlightLayer.getAttribute("disabled") == "true")
this.hide ();
else
- this.askForBounds();
+ this.show ();
}, this));
highlightLayer.appendChild(contentShowingObserver)
// Hook in to relevant events
- window.messageManager.addMessageListener(
- "MozScrolledAreaChanged", Callback(this.askForBounds, this));
window.Browser.controlsScrollbox.addEventListener(
'scroll', Callback(this.askForBounds, this));
window.addEventListener('TabSelect', Callback(this.askForBounds, this));
Please sign in to comment.
Something went wrong with that request. Please try again.