From 22bd360d83b049656c74424d16206285d202f45f Mon Sep 17 00:00:00 2001 From: Gavin Sharp Date: Sun, 5 Apr 2009 03:22:58 -0400 Subject: [PATCH] Bug 486562: remove unused widgetStack handleEvents code, r=bcombee/vlad --- mobile/chrome/content/WidgetStack.js | 64 ---------------------------- 1 file changed, 64 deletions(-) diff --git a/mobile/chrome/content/WidgetStack.js b/mobile/chrome/content/WidgetStack.js index 1971aae195a6..5c4f8392d56a 100644 --- a/mobile/chrome/content/WidgetStack.js +++ b/mobile/chrome/content/WidgetStack.js @@ -395,18 +395,6 @@ WidgetStack.prototype = { } }, - // handleEvents: if this is called, WS will install its own event handlers - // on the stack element for mouse clicks and motion. Otherwise, the application - // must call dragStart/dragMove/dragStop as appropriate. - handleEvents: function () { - let self = this; - - let e = window; - e.addEventListener("mousedown", function (ev) { return self._onMouseDown(ev); }, true); - e.addEventListener("mouseup", function (ev) { return self._onMouseUp(ev); }, true); - e.addEventListener("mousemove", function (ev) { return self._onMouseMove(ev); }, true); - }, - // moveWidgetBy: move the widget with the given id by x,y. Should // not be used on vp-relative or otherwise frozen widgets (using it // on the x coordinate for x-ignore widgets and similarily for y is @@ -818,61 +806,10 @@ WidgetStack.prototype = { return w; }, - _onMouseDown: function (ev) { - log("(mousedown)"); - this.dragStart(ev.screenX, ev.screenY); - - // we haven't yet recognized a drag; whatever happens make - // sure we start one after 50ms. - this._dragState.dragging = false; - - let self = this; - this._dragState.dragStartTimeout = setTimeout(function () { - self._dragState.dragStartTimeout = -1; - self._delayedDragStart(); - self._dragUpdate(); - }, 50); - }, - - _onMouseUp: function (ev) { - log("(mouseup)"); - if (!this._dragState) - return; - - if (this._dragState.dragStartTimeout != -1) - clearTimeout(this._dragState.dragStartTimeout); - - this.dragStop(); - }, - - _onMouseMove: function (ev) { - if (!this._dragging) - return; - - this._dragCoordsFromClient(ev.screenX, ev.screenY); - - if (!this._dragging && this._dragState.outerDistSquared > 100) - this._delayedDragStart(); - - this.dragMove(ev.screenX, ev.screenY); - }, - get _dragging() { return this._dragState && this._dragState.dragging; }, - // dragStart: a drag was started, either by distance or by time. - _delayedDragStart: function () { - log("(dragStart)"); - if (this._dragging) - return; - - if (this._dragState.dragStartTimeout != -1) - clearTimeout(this._dragState.dragStartTimeout); - - this._dragState.dragging = true; - }, - _viewportUpdate: function _viewportUpdate() { if (!this._viewport) return; @@ -931,7 +868,6 @@ WidgetStack.prototype = { let dy = this._dragState.outerCurY - this._dragState.outerStartY; this._dragState.outerDX = dx; this._dragState.outerDY = dy; - this._dragState.outerDistSquared = dx*dx + dy*dy; }, _panHandleBarriers: function (dx, dy) {