зеркало из https://github.com/mozilla/ubiquity.git
Removed pointless event capturings. Fixed misplaced returns.
This commit is contained in:
Родитель
f56949132f
Коммит
52601e30de
|
@ -64,15 +64,15 @@ function Ubiquity(msgPanel, textBox, cmdManager) {
|
|||
|
||||
window.addEventListener("mousemove", this, false);
|
||||
|
||||
textBox.addEventListener("keydown", this, true);
|
||||
textBox.addEventListener("keypress", this, true);
|
||||
textBox.addEventListener("keyup", this, true);
|
||||
textBox.addEventListener("keydown", this, false);
|
||||
textBox.addEventListener("keypress", this, false);
|
||||
textBox.addEventListener("keyup", this, false);
|
||||
if (this.Utils.OS === "WINNT") textBox.addEventListener("blur", this, false);
|
||||
|
||||
msgPanel.addEventListener("popupshowing", this, false);
|
||||
msgPanel.addEventListener("popupshown", this, false);
|
||||
msgPanel.addEventListener("popuphidden", this, false);
|
||||
msgPanel.addEventListener("click", this, true);
|
||||
msgPanel.addEventListener("click", this, false);
|
||||
|
||||
var self = this;
|
||||
self.__onSuggestionsUpdated = function U__onSuggestionsUpdated() {
|
||||
|
|
|
@ -118,8 +118,8 @@ function CommandManager(cmdSource, msgService, parser,
|
|||
if (parser) this._loadCommands();
|
||||
this.setPreviewState("no-suggestions");
|
||||
|
||||
suggDoc.addEventListener("click", this, true);
|
||||
suggDoc.addEventListener("DOMMouseScroll", this, true);
|
||||
suggDoc.addEventListener("click", this, false);
|
||||
suggDoc.addEventListener("DOMMouseScroll", this, false);
|
||||
}
|
||||
|
||||
CommandManager.prototype = {
|
||||
|
@ -135,16 +135,15 @@ CommandManager.prototype = {
|
|||
if (this.__hilitedIndex === index) return;
|
||||
this.__hilitedIndex = index;
|
||||
this.__lastAsyncSuggestionCb();
|
||||
break;
|
||||
}
|
||||
} break;
|
||||
case "DOMMouseScroll": {
|
||||
this[event.detail < 0 ? "moveIndicationUp" : "moveIndicationDown"]();
|
||||
this.__lastAsyncSuggestionCb();
|
||||
break;
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
} break;
|
||||
default: return;
|
||||
}
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
},
|
||||
|
||||
setPreviewState: function CM_setPreviewState(state) {
|
||||
|
|
|
@ -1222,7 +1222,6 @@ function regexp(pattern, flags) {
|
|||
} catch (e if e instanceof SyntaxError) {
|
||||
return RegExp(regexp.quote(pattern), flags);
|
||||
}
|
||||
return RegExp();
|
||||
}
|
||||
|
||||
// === {{{ Utils.regexp.quote(string) }}} ===
|
||||
|
|
Загрузка…
Ссылка в новой задаче