зеркало из https://github.com/mozilla/pjs.git
Bug 232827 Fix Error: aTarget has no properties p=gautheri@noos.fr r=me sr=jag
This commit is contained in:
Родитель
cfc942cdcf
Коммит
d47ed3cb29
|
@ -814,7 +814,7 @@ var BookmarksController = {
|
|||
case "cmd_bm_redo":
|
||||
return BMSVC.transactionManager.numberOfRedoItems > 0;
|
||||
case "cmd_bm_paste":
|
||||
if (!BookmarksUtils.isValidTargetContainer(aTarget.parent))
|
||||
if (!(aTarget && BookmarksUtils.isValidTargetContainer(aTarget.parent)))
|
||||
return false;
|
||||
const kClipboardContractID = "@mozilla.org/widget/clipboard;1";
|
||||
const kClipboardIID = Components.interfaces.nsIClipboard;
|
||||
|
@ -853,7 +853,8 @@ var BookmarksController = {
|
|||
case "cmd_bm_newbookmark":
|
||||
case "cmd_bm_newfolder":
|
||||
case "cmd_bm_newseparator":
|
||||
return BookmarksUtils.isValidTargetContainer(aTarget.parent);
|
||||
return (aTarget &&
|
||||
BookmarksUtils.isValidTargetContainer(aTarget.parent));
|
||||
case "cmd_bm_properties":
|
||||
case "cmd_bm_rename":
|
||||
case "cmd_bm_sortfolderbyname":
|
||||
|
@ -973,10 +974,9 @@ var BookmarksController = {
|
|||
"cmd_bm_sortfolder", "cmd_bm_sortfolderbyname",
|
||||
"cmd_undo", "cmd_redo", "cmd_bm_undo", "cmd_bm_redo"];
|
||||
for (var i = 0; i < commands.length; ++i) {
|
||||
var enabled = this.isCommandEnabled(commands[i], aSelection, aTarget);
|
||||
var commandNode = document.getElementById(commands[i]);
|
||||
if (commandNode) {
|
||||
if (enabled)
|
||||
if (commandNode) {
|
||||
if (this.isCommandEnabled(commands[i], aSelection, aTarget))
|
||||
commandNode.removeAttribute("disabled");
|
||||
else
|
||||
commandNode.setAttribute("disabled", "true");
|
||||
|
|
|
@ -368,9 +368,7 @@
|
|||
<method name="createTreeContextMenu">
|
||||
<parameter name="aEvent"/>
|
||||
<body><![CDATA[
|
||||
var selection = this._selection;
|
||||
var target = this._target;
|
||||
BookmarksCommand.createContextMenu(aEvent, selection);
|
||||
BookmarksCommand.createContextMenu(aEvent, this._selection);
|
||||
this.onCommandUpdate();
|
||||
]]></body>
|
||||
</method>
|
||||
|
@ -500,9 +498,9 @@
|
|||
isCommandEnabled: function (aCommand)
|
||||
{
|
||||
// warning: this is not the called function in BookmarksController.onCommandUpdate
|
||||
var selection = this.mOuter._selection;
|
||||
var target = this.mOuter._target;
|
||||
return BookmarksController.isCommandEnabled(aCommand, selection, target)
|
||||
return BookmarksController.isCommandEnabled(aCommand,
|
||||
this.mOuter._selection,
|
||||
this.mOuter._target);
|
||||
},
|
||||
|
||||
doCommand: function (aCommand)
|
||||
|
@ -560,9 +558,7 @@
|
|||
|
||||
<method name="onCommandUpdate">
|
||||
<body><![CDATA[
|
||||
var selection = this._selection;
|
||||
var target = this._target;
|
||||
BookmarksController.onCommandUpdate(selection, target);
|
||||
BookmarksController.onCommandUpdate(this._selection, this._target);
|
||||
]]></body>
|
||||
</method>
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче