зеркало из https://github.com/mozilla/gecko-dev.git
Bug 364828 - PlacesController efficiency improvements - update places-specific commands for places-events only. r=sspitzer.
This commit is contained in:
Родитель
85e07aa89f
Коммит
c6158a3ced
|
@ -36,7 +36,7 @@
|
|||
|
||||
<commandset id="placesCommands"
|
||||
commandupdater="true"
|
||||
events="focus,select"
|
||||
events="places-select"
|
||||
oncommandupdate="goUpdatePlacesCommands();">>
|
||||
<command id="placesCmd_open"
|
||||
label="&cmd.open.label;"
|
||||
|
|
|
@ -736,7 +736,7 @@
|
|||
<body><![CDATA[
|
||||
// When right clicking an item in a bookmarks menu the places commands
|
||||
// need to be updated for the context menu to appear correctly.
|
||||
window.updateCommands("select");
|
||||
PlacesUtils.updateAllCommands();
|
||||
this.controller.buildContextMenu(aPopup);
|
||||
]]></body>
|
||||
</method>
|
||||
|
@ -745,7 +745,7 @@
|
|||
<handler event="popupshowing">
|
||||
if (event.target == this) {
|
||||
this._enableEditCommands = true;
|
||||
window.updateCommands("select");
|
||||
PlacesUtils.updateAllCommands();
|
||||
this.onPopupShowing();
|
||||
}
|
||||
</handler>
|
||||
|
@ -760,7 +760,7 @@
|
|||
// when the folder closes because it is no longer applicable.
|
||||
this.removeAttribute("autoopened");
|
||||
this._enableEditCommands = false;
|
||||
window.updateCommands("select");
|
||||
PlacesUtils.updateAllCommands();
|
||||
}
|
||||
</handler>
|
||||
<!-- Set selected node/active view on mousedown/DOMMenuItemActive events
|
||||
|
|
|
@ -901,7 +901,7 @@
|
|||
<parameter name="aPopup"/>
|
||||
<body><![CDATA[
|
||||
this._enableEditCommands = true;
|
||||
window.updateCommands("select");
|
||||
PlacesUtils.updateAllCommands();
|
||||
aPopup.addEventListener("popuphiding", this, true);
|
||||
this.controller.buildContextMenu(aPopup);
|
||||
]]></body>
|
||||
|
@ -914,7 +914,7 @@
|
|||
if (aEvent.type == "popuphiding" &&
|
||||
aEvent.eventPhase == Event.AT_TARGET) {
|
||||
this._enableEditCommands = false;
|
||||
window.updateCommands("select");
|
||||
PlacesUtils.updateAllCommands();
|
||||
aEvent.target.removeEventListener("popuphiding", this, true);
|
||||
}
|
||||
]]></body>
|
||||
|
@ -930,7 +930,7 @@
|
|||
else
|
||||
this._selection = this.getResult().root;
|
||||
|
||||
window.updateCommands("select");
|
||||
window.updateCommands("places-select");
|
||||
]]></handler>
|
||||
<handler event="draggesture"><![CDATA[
|
||||
if (event.target.localName == "toolbarbutton")
|
||||
|
|
|
@ -1005,9 +1005,12 @@
|
|||
</method>
|
||||
</implementation>
|
||||
<handlers>
|
||||
<handler event="select"><![CDATA[
|
||||
window.updateCommands("select");
|
||||
]]></handler>
|
||||
<!-- Edit commands are updated by the global focus command updater
|
||||
in editMenuOverlay -->
|
||||
<handler event="focus" action="window.updateCommands('places-select')"/>
|
||||
<handler event="blur" action="window.updateCommands('places-select')"/>
|
||||
|
||||
<handler event="select" action="PlacesUtils.updateAllCommands();"/>
|
||||
<handler event="draggesture"><![CDATA[
|
||||
// XXXben ew.
|
||||
if (event.target.localName == "treechildren")
|
||||
|
|
|
@ -644,5 +644,13 @@ var PlacesUtils = {
|
|||
}
|
||||
|
||||
return null;
|
||||
},
|
||||
|
||||
/**
|
||||
* Update both edit and places-specific commands
|
||||
*/
|
||||
updateAllCommands: function() {
|
||||
window.updateCommands("select");
|
||||
window.updateCommands("places-select");
|
||||
}
|
||||
};
|
||||
|
|
Загрузка…
Ссылка в новой задаче