Bug 934532 - [Australis] clicking in a blank area of the panel shouldn't close it, r=jaws

This commit is contained in:
Gijs Kruitbosch 2013-11-15 13:38:21 +01:00
parent 81ed5c9b26
commit 8419732291

View File

@ -1084,19 +1084,23 @@ let CustomizableUIInternal = {
/*
* If people put things in the panel which need more than single-click interaction,
* we don't want to close it. Right now we check for text inputs and menu buttons.
* Anything else we should take care of?
* We also check for being outside of any toolbaritem/toolbarbutton, ie on a blank
* part of the menu.
*/
_isOnInteractiveElement: function(aEvent) {
let target = aEvent.originalTarget;
let panel = aEvent.currentTarget;
let panel = this._getPanelForNode(aEvent.currentTarget);
let inInput = false;
let inMenu = false;
while (!inInput && !inMenu && target != aEvent.currentTarget) {
inInput = target.localName == "input";
let inItem = false;
while (!inInput && !inMenu && !inItem && target != panel) {
let tagName = target.localName;
inInput = tagName == "input";
inMenu = target.type == "menu";
inItem = tagName == "toolbaritem" || tagName == "toolbarbutton";
target = target.parentNode;
}
return inMenu || inInput;
return inMenu || inInput || !inItem;
},
hidePanelForNode: function(aNode) {