Bug 1356641 - Ctrl+click location item loads wrong URL. r=mak

With ideas and code from Oriol <oriol-bugzilla@hotmail.com>.

MozReview-Commit-ID: CjuCAkYaort

--HG--
extra : rebase_source : dd53d1a665a5aba8ef094ee82dffe9c6c010d3d6
This commit is contained in:
Drew Willcoxon 2017-04-21 14:16:31 -07:00
Родитель a34d0bbc9d
Коммит c03f04221e
1 изменённых файлов: 39 добавлений и 0 удалений

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

@ -2496,6 +2496,45 @@ extends="chrome://global/content/bindings/popup.xml#popup">
]]></body>
</method>
</implementation>
<handlers>
<!--
This overrides listitem's mousedown handler because we want to set the
selected item even when the shift or accel keys are pressed.
-->
<handler event="mousedown"><![CDATA[
// Call this.control only once since it's not a simple getter.
let control = this.control;
if (!control || control.disabled) {
return;
}
if (!this.selected) {
control.selectItem(this);
}
control.currentItem = this;
]]></handler>
<handler event="mouseover"><![CDATA[
// The point of implementing this handler is to allow drags to change
// the selected item. If the user mouses down on an item, it becomes
// selected. If they then drag the mouse to another item, select it.
// Handle all three primary mouse buttons: right, left, and wheel, since
// all three change the selection on mousedown.
let mouseDown = event.buttons & 0b111;
if (!mouseDown) {
return;
}
// Call this.control only once since it's not a simple getter.
let control = this.control;
if (!control || control.disabled) {
return;
}
if (!this.selected) {
control.selectItem(this);
}
control.currentItem = this;
]]></handler>
</handlers>
</binding>
<binding id="autocomplete-tree" extends="chrome://global/content/bindings/tree.xml#tree">