Bug 895243 - Hide selection monocles when the user edge swipes to hide the urlbar. r=mbrubeck

This commit is contained in:
Jim Mathies 2013-07-19 08:55:21 -05:00
Родитель e55f8e9dc0
Коммит 15c6ac9dfd
2 изменённых файлов: 28 добавлений и 0 удалений

Просмотреть файл

@ -272,6 +272,14 @@ var ChromeSelectionHandler = {
this.sendAsync("Content:HandlerShutdown", {});
},
get hasSelection() {
if (!this._targetElement) {
return false;
}
let selection = this._getSelection();
return (selection && !selection.isCollapsed);
},
/*************************************************
* Events
*/

Просмотреть файл

@ -525,6 +525,7 @@ var SelectionHelperUI = {
Elements.browsers.addEventListener("ZoomChanged", this, true);
Elements.navbar.addEventListener("transitionend", this, true);
Elements.navbar.addEventListener("MozAppbarDismissing", this, true);
this.overlay.enabled = true;
},
@ -551,6 +552,7 @@ var SelectionHelperUI = {
Elements.browsers.removeEventListener("ZoomChanged", this, true);
Elements.navbar.removeEventListener("transitionend", this, true);
Elements.navbar.removeEventListener("MozAppbarDismissing", this, true);
this._shutdownAllMarkers();
@ -897,9 +899,23 @@ var SelectionHelperUI = {
if (this.layerMode == kContentLayer) {
return;
}
if (aEvent.propertyName == "bottom" && Elements.navbar.isShowing) {
this._sendAsyncMessage("Browser:SelectionUpdate", {});
return;
}
if (aEvent.propertyName == "transform" && Elements.navbar.isShowing) {
this._sendAsyncMessage("Browser:SelectionUpdate", {});
this._showMonocles(ChromeSelectionHandler.hasSelection);
}
},
_onNavBarDismissEvent: function _onNavBarDismissEvent() {
if (!this.isActive || this.layerMode == kContentLayer) {
return;
}
this._hideMonocles();
},
/*
@ -1051,6 +1067,10 @@ var SelectionHelperUI = {
case "transitionend":
this._onNavBarTransitionEvent(aEvent);
break;
case "MozAppbarDismissing":
this._onNavBarDismissEvent();
break;
}
},