зеркало из https://github.com/mozilla/gecko-dev.git
Bug 902539 - Make VariablesView ignore right clicks. r=vp
This commit is contained in:
Родитель
0b635b8e37
Коммит
d9f3fb82dc
|
@ -100,19 +100,26 @@ function test() {
|
|||
ok(!testScope.expanded,
|
||||
"The testScope should remember it is collapsed after it is reshown.");
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "mousedown", button: 1 },
|
||||
testScope.target.querySelector(".title"),
|
||||
aPanel.panelWin);
|
||||
|
||||
ok(!testScope.expanded,
|
||||
"Clicking the testScope title with the right mouse button should't expand it.");
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" },
|
||||
testScope.target.querySelector(".title"),
|
||||
aPanel.panelWin);
|
||||
|
||||
ok(testScope.expanded,
|
||||
"Clicking the testScope tilte should expand it.");
|
||||
"Clicking the testScope title should expand it.");
|
||||
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" },
|
||||
testScope.target.querySelector(".title"),
|
||||
aPanel.panelWin);
|
||||
|
||||
ok(!testScope.expanded,
|
||||
"Clicking again the testScope tilte should collapse it.");
|
||||
"Clicking again the testScope title should collapse it.");
|
||||
|
||||
closeDebuggerAndFinish(aPanel);
|
||||
});
|
||||
|
|
|
@ -1651,7 +1651,8 @@ Scope.prototype = {
|
|||
* The click listener for this scope's title.
|
||||
*/
|
||||
_onClick: function(e) {
|
||||
if (e.target == this._inputNode ||
|
||||
if (e.button != 0 ||
|
||||
e.target == this._inputNode ||
|
||||
e.target == this._editNode ||
|
||||
e.target == this._deleteNode) {
|
||||
return;
|
||||
|
@ -2778,6 +2779,10 @@ Variable.prototype = Heritage.extend(Scope.prototype, {
|
|||
* The click listener for the edit button.
|
||||
*/
|
||||
_onEdit: function(e) {
|
||||
if (e.button != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
this._activateValueInput();
|
||||
|
@ -2787,6 +2792,10 @@ Variable.prototype = Heritage.extend(Scope.prototype, {
|
|||
* The click listener for the delete button.
|
||||
*/
|
||||
_onDelete: function(e) {
|
||||
if ("button" in e && e.button != 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче