Bug 765390 - (Part 2) Text selection should be cleared on pagehide. r=mbrubeck

This commit is contained in:
Margaret Leibovic 2012-06-23 15:46:21 -07:00
parent 059aa9a2a4
commit fbd3f6fb54

View File

@ -1699,6 +1699,8 @@ var SelectionHandler = {
this._start.addEventListener("touchstart", this, true);
this._end.addEventListener("touchstart", this, true);
this._view.addEventListener("pagehide", this, false);
},
hideHandles: function sh_hideHandles() {
@ -1716,6 +1718,8 @@ var SelectionHandler = {
this._start = null;
this._end = null;
this._view.removeEventListener("pagehide", this, false);
},
_touchId: null,
@ -1759,6 +1763,10 @@ var SelectionHandler = {
this.moveSelection(isStartHandle, touch.clientX - this._touchDelta.x,
touch.clientY - this._touchDelta.y);
break;
case "pagehide":
this.endSelection(0, 0);
break;
}
}
};