Skip to content

Commit

Permalink
Firefox 54 compatibility: rename "new" and "delete" XBL methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dstillman committed May 22, 2017
1 parent ddc9989 commit a3eea03
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions chrome/content/zotero/bindings/noteeditor.xml
Expand Up @@ -442,7 +442,7 @@
// If editable and no existing tags, open new empty row
var tagsBox = this.id('tags');
if (tagsBox.mode == 'edit' && tagsBox.count == 0) {
this.id('tags').new();
this.id('tags').newTag();
}
]]></body>
</method>
Expand Down Expand Up @@ -573,7 +573,7 @@
tagsbox and tagsLabel above, so be sure to update fixPopup() if it changes
-->
<xul:menupopup id="tagsPopup" ignorekeys="true"
onpopupshown="if (!document.commandDispatcher.focusedElement || document.commandDispatcher.focusedElement.tagName=='xul:label'){ /* DEBUG: it would be nice to make this work -- if (this.firstChild.count==0){ this.firstChild.new(); } */ this.setAttribute('showing', 'true'); }"
onpopupshown="if (!document.commandDispatcher.focusedElement || document.commandDispatcher.focusedElement.tagName=='xul:label'){ /* DEBUG: it would be nice to make this work -- if (this.firstChild.count==0){ this.firstChild.newTag(); } */ this.setAttribute('showing', 'true'); }"
onpopuphidden="if (!document.commandDispatcher.focusedElement || document.commandDispatcher.focusedElement.tagName=='xul:label'){ this.setAttribute('showing', 'false'); }">
<xul:tagsbox id="tags" flex="1" mode="edit"/>
</xul:menupopup>
Expand Down
6 changes: 3 additions & 3 deletions chrome/content/zotero/bindings/tagsbox.xml
Expand Up @@ -725,7 +725,7 @@
</method>


<method name="new">
<method name="newTag">
<body>
<![CDATA[
var rowsElement = this.id('tagRows');
Expand Down Expand Up @@ -954,7 +954,7 @@
next.click();
}
else {
next = this.new();
next = this.newTag();
next = next.firstChild.nextSibling;
}
Expand Down Expand Up @@ -1056,7 +1056,7 @@
<xul:label id="tagsNum"/>
<xul:button id="addButton" label="&zotero.item.add;"
onkeypress="return document.getBindingParent(this)._onAddButtonKeypress(event)"
oncommand="document.getBindingParent(this).new();"/>
oncommand="document.getBindingParent(this).newTag();"/>
</xul:hbox>
<xul:grid>
<xul:columns>
Expand Down
4 changes: 2 additions & 2 deletions chrome/content/zotero/bindings/tagselector.xml
Expand Up @@ -805,7 +805,7 @@
</method>


<method name="delete">
<method name="deleteTag">
<parameter name="name"/>
<body><![CDATA[
return Zotero.spawn(function* () {
Expand Down Expand Up @@ -1090,7 +1090,7 @@
<menuitem label="&zotero.tagSelector.renameTag;"
oncommand="document.getBindingParent(this).rename(_popupNode.textContent); event.stopPropagation()"/>
<menuitem label="&zotero.tagSelector.deleteTag;"
oncommand="document.getBindingParent(this).delete(_popupNode.textContent); event.stopPropagation()"/>
oncommand="document.getBindingParent(this).deleteTag(_popupNode.textContent); event.stopPropagation()"/>
</menupopup>

<deck id="tags-deck">
Expand Down
2 changes: 1 addition & 1 deletion test/tests/tagSelectorTest.js
Expand Up @@ -363,7 +363,7 @@ describe("Tag Selector", function () {
promise = waitForTagSelector(win);
var dialogPromise = waitForDialog();
var tagSelector = doc.getElementById('zotero-tag-selector');
yield tagSelector.delete("A");
yield tagSelector.deleteTag("A");
yield promise;

// Tag selector shouldn't show the deleted item's tag
Expand Down

0 comments on commit a3eea03

Please sign in to comment.