Changeset View
Changeset View
Standalone View
Standalone View
webroot/rsrc/externals/javelin/lib/control/typeahead/Typeahead.js
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | JX.DOM.listen( | ||||
null, | null, | ||||
JX.bind(this, this._onmouse)); | JX.bind(this, this._onmouse)); | ||||
JX.DOM.listen( | JX.DOM.listen( | ||||
this._root, | this._root, | ||||
'mousedown', | 'mousedown', | ||||
'tag:a', | 'tag:a', | ||||
JX.bind(this, function(e) { | JX.bind(this, function(e) { | ||||
if (!e.isRightButton()) { | if (e.isNormalMouseEvent()) { | ||||
this._choose(e.getNode('tag:a')); | this._choose(e.getNode('tag:a')); | ||||
} else { | |||||
// fix the middle-click and any non-normal mouse event | |||||
// in order to have an "open in a new tab" that just works natively | |||||
// or any other browser action that is supposed to be there. | |||||
// | |||||
// Probably this is one of the specific cases where kill() has | |||||
// sense instead of just stop(), since there are not much chances | |||||
// that another event listener had anything else to do | |||||
// during non-normal mousedown/click events. | |||||
// https://we.phorge.it/T15149 | |||||
e.kill(); | |||||
} | } | ||||
})); | })); | ||||
}, | }, | ||||
events : ['choose', 'query', 'start', 'change', 'show'], | events : ['choose', 'query', 'start', 'change', 'show'], | ||||
properties : { | properties : { | ||||
▲ Show 20 Lines • Show All 464 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0