Bug 495437: ContentClickingModule uses clickTimeout but means _clickTimeout, r=mfinkle
authorBen Combee <combee@mozilla.com>
Sun, 31 May 2009 00:34:53 -0400
changeset 65234 1d9d0309846b7aff56d9d66df1827e5a663d6e52
parent 65233 424ecd4cb6a441fa5f816ef1b705011985d59c0e
child 65235 ef14b1e3c637dac4557914519af7443a13cbdfbe
push idunknown
push userunknown
push dateunknown
reviewersmfinkle
bugs495437
Bug 495437: ContentClickingModule uses clickTimeout but means _clickTimeout, r=mfinkle
mobile/chrome/content/InputHandler.js
--- a/mobile/chrome/content/InputHandler.js
+++ b/mobile/chrome/content/InputHandler.js
@@ -721,36 +721,37 @@ ContentClickingModule.prototype = {
 
     switch (aEvent.type) {
       // UI panning events
       case "mousedown":
         this._events.push({event: aEvent, time: Date.now()});
 
         // we're waiting for a click
         if (this._clickTimeout != -1) {
-          // if we just got another mousedown, don't send anything until we get another mousedown
+          // go ahead and stop the timeout so no single click gets
+          // sent, but don't clear clickTimeout here so that mouseUp
+          // handler will treat this as a double click
           window.clearTimeout(this._clickTimeout);
-          this.clickTimeout = -1;
         }
         break;
       case "mouseup":
         // keep an eye out for mouseups that didn't start with a mousedown
         if (!(this._events.length % 2)) {
           this._reset();
           break;
         }
 
         this._events.push({event: aEvent, time: Date.now()});
 
         if (this._clickTimeout == -1) {
           this._clickTimeout = window.setTimeout(function(self) { self._sendSingleClick(); }, 400, this);
         }
         else {
           window.clearTimeout(this._clickTimeout);
-          this.clickTimeout = -1;
+          this._clickTimeout = -1;
           this._sendDoubleClick();
         }
         break;
     }
   },
 
   /* If someone else grabs events ahead of us, cancel any pending
    * timeouts we may have.