mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 491221 - default button styling missing in the bookmarks properties dialog. r=mak, enn
This commit is contained in:
parent
f287b2c981
commit
ecd153a3b8
@ -65,7 +65,7 @@ var StarUI = {
|
||||
// to avoid impacting startup / new window performance
|
||||
element.hidden = false;
|
||||
element.addEventListener("popuphidden", this, false);
|
||||
element.addEventListener("keypress", this, true);
|
||||
element.addEventListener("keypress", this, false);
|
||||
return this.panel = element;
|
||||
},
|
||||
|
||||
@ -112,25 +112,25 @@ var StarUI = {
|
||||
}
|
||||
break;
|
||||
case "keypress":
|
||||
if (aEvent.keyCode == KeyEvent.DOM_VK_ESCAPE) {
|
||||
// If the panel is visible the ESC key is mapped to the cancel button
|
||||
// unless we are editing a folder in the folderTree, or an
|
||||
// autocomplete popup is open.
|
||||
if (!this._element("editBookmarkPanelContent").hidden) {
|
||||
var elt = aEvent.target;
|
||||
if ((elt.localName != "tree" || !elt.hasAttribute("editing")) &&
|
||||
!elt.popupOpen)
|
||||
this.cancelButtonOnCommand();
|
||||
}
|
||||
if (aEvent.getPreventDefault()) {
|
||||
// The event has already been consumed inside of the panel.
|
||||
break;
|
||||
}
|
||||
else if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN) {
|
||||
// hide the panel unless the folder tree or an expander are focused
|
||||
// or an autocomplete popup is open.
|
||||
if (aEvent.target.localName != "tree" &&
|
||||
aEvent.target.className != "expander-up" &&
|
||||
aEvent.target.className != "expander-down" &&
|
||||
!aEvent.target.popupOpen)
|
||||
switch (aEvent.keyCode) {
|
||||
case KeyEvent.DOM_VK_ESCAPE:
|
||||
if (!this._element("editBookmarkPanelContent").hidden)
|
||||
this.cancelButtonOnCommand();
|
||||
break;
|
||||
case KeyEvent.DOM_VK_RETURN:
|
||||
if (aEvent.target.className == "expander-up" ||
|
||||
aEvent.target.className == "expander-down" ||
|
||||
aEvent.target.id == "editBMPanel_newFolderButton") {
|
||||
//XXX Why is this necessary? The getPreventDefault() check should
|
||||
// be enough.
|
||||
break;
|
||||
}
|
||||
this.panel.hidePopup();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
@ -374,10 +374,6 @@ var BookmarkPropertiesPanel = {
|
||||
this._element("siteLocationField")
|
||||
.addEventListener("input", this, false);
|
||||
}
|
||||
|
||||
// Set on document to get the event before an autocomplete popup could
|
||||
// be hidden on Enter.
|
||||
document.addEventListener("keypress", this, true);
|
||||
}
|
||||
|
||||
window.sizeToContent();
|
||||
@ -388,27 +384,6 @@ var BookmarkPropertiesPanel = {
|
||||
handleEvent: function BPP_handleEvent(aEvent) {
|
||||
var target = aEvent.target;
|
||||
switch (aEvent.type) {
|
||||
case "keypress":
|
||||
function canAcceptDialog(aElement) {
|
||||
// on Enter we accept the dialog unless:
|
||||
// - the folder tree is focused
|
||||
// - an expander is focused
|
||||
// - an autocomplete (eg. tags) popup is open
|
||||
// - a menulist is open
|
||||
// - a multiline textbox is focused
|
||||
return aElement.localName != "tree" &&
|
||||
aElement.className != "expander-up" &&
|
||||
aElement.className != "expander-down" &&
|
||||
!aElement.popupOpen &&
|
||||
!aElement.open &&
|
||||
!(aElement.localName == "textbox" &&
|
||||
aElement.getAttribute("multiline") == "true");
|
||||
}
|
||||
if (aEvent.keyCode == KeyEvent.DOM_VK_RETURN &&
|
||||
canAcceptDialog(target))
|
||||
document.documentElement.acceptDialog();
|
||||
break;
|
||||
|
||||
case "input":
|
||||
if (target.id == "editBMPanel_locationField" ||
|
||||
target.id == "editBMPanel_feedLocationField" ||
|
||||
@ -506,7 +481,6 @@ var BookmarkPropertiesPanel = {
|
||||
// currently registered EventListener on the EventTarget has no effect.
|
||||
this._element("tagsSelectorRow")
|
||||
.removeEventListener("DOMAttrModified", this, false);
|
||||
document.removeEventListener("keypress", this, true);
|
||||
this._element("folderTreeRow")
|
||||
.removeEventListener("DOMAttrModified", this, false);
|
||||
this._element("locationField")
|
||||
|
@ -54,7 +54,6 @@
|
||||
|
||||
<dialog id="bookmarkproperties"
|
||||
buttons="accept, cancel"
|
||||
defaultButton="none"
|
||||
ondialogaccept="BookmarkPropertiesPanel.onDialogAccept();"
|
||||
ondialogcancel="BookmarkPropertiesPanel.onDialogCancel();"
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
|
@ -710,11 +710,13 @@
|
||||
if (this._editingColumn) {
|
||||
this.stopEditing(true);
|
||||
this.focus();
|
||||
event.stopPropagation();
|
||||
}
|
||||
else {
|
||||
this.changeOpenState(this.currentIndex);
|
||||
if (!this.changeOpenState(this.currentIndex))
|
||||
return; // don't consume the event if the open state wasn't changed
|
||||
}
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keypress" keycode="VK_RETURN">
|
||||
@ -722,11 +724,13 @@
|
||||
if (this._editingColumn) {
|
||||
this.stopEditing(true);
|
||||
this.focus();
|
||||
event.stopPropagation();
|
||||
}
|
||||
else {
|
||||
this.changeOpenState(this.currentIndex);
|
||||
if (!this.changeOpenState(this.currentIndex))
|
||||
return; // don't consume the event if the open state wasn't changed
|
||||
}
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
]]>
|
||||
</handler>
|
||||
<handler event="keypress" keycode="VK_ESCAPE">
|
||||
@ -735,6 +739,7 @@
|
||||
this.stopEditing(false);
|
||||
this.focus();
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
}
|
||||
]]>
|
||||
</handler>
|
||||
|
Loading…
Reference in New Issue
Block a user