Bug 1240917 - Tweak ActionBar behavior when selection is collapsed. r=snorp

* Long pressing on empty input -> show the ActionBar.
* Single tapping on input (either empty or non-empty) -> do not show the
  ActionBar.
This commit is contained in:
Ting-Yu Lin 2016-02-02 14:32:31 +08:00
parent 5327de631c
commit 103832f156

View File

@ -35,6 +35,27 @@ var ActionBarHandler = {
return;
}
if (!this._selectionID && e.collapsed) {
switch (e.reason) {
case 'longpressonemptycontent':
// case 'taponcaret':
// Show ActionBar when long pressing on an empty input.
// XXX: If we ever want to show ActionBar when single tapping on the
// caret, uncomment the above case 'taponcaret'.
this._init();
break;
case 'updateposition':
// Do not show ActionBar when single tapping on an non-empty editable
// input.
break;
default:
break;
}
return;
}
// Open a closed ActionBar if carets actually visible.
if (!this._selectionID && e.caretVisuallyVisible) {
this._init();