Fix #1027, 5.0: Not possible anymore to add tags to notes
Still a little weirdness in the tags popup that I'll clean up, but it should work now.
This commit is contained in:
parent
fdd90b04d3
commit
41fe8365a9
|
@ -83,7 +83,7 @@
|
||||||
|
|
||||||
this._mode = val;
|
this._mode = val;
|
||||||
document.getAnonymousNodes(this)[0].setAttribute('mode', val);
|
document.getAnonymousNodes(this)[0].setAttribute('mode', val);
|
||||||
this._id('links').mode = val;
|
this._id('links-box').mode = val;
|
||||||
]]>
|
]]>
|
||||||
</setter>
|
</setter>
|
||||||
</property>
|
</property>
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
<property name="parentItem" onget="return this._parentItem;">
|
<property name="parentItem" onget="return this._parentItem;">
|
||||||
<setter>
|
<setter>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
this._parentItem = this._id('links').parentItem = val;
|
this._parentItem = this._id('links-box').parentItem = val;
|
||||||
]]>
|
]]>
|
||||||
</setter>
|
</setter>
|
||||||
</property>
|
</property>
|
||||||
|
@ -111,7 +111,7 @@
|
||||||
this.parentItem = Zotero.Items.getByLibraryAndKey(this.item.libraryID, parentKey);
|
this.parentItem = Zotero.Items.getByLibraryAndKey(this.item.libraryID, parentKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
this._id('links').item = this.item;
|
this._id('links-box').item = this.item;
|
||||||
|
|
||||||
this.refresh();
|
this.refresh();
|
||||||
]]></setter>
|
]]></setter>
|
||||||
|
@ -121,10 +121,10 @@
|
||||||
<setter>
|
<setter>
|
||||||
<![CDATA[
|
<![CDATA[
|
||||||
if(val) {
|
if(val) {
|
||||||
var links = this._id('linksbox');
|
var container = this._id('links-container');
|
||||||
var parent = links.parentNode;
|
var parent = container.parentNode;
|
||||||
var sib = links.nextSibling;
|
var sib = container.nextSibling;
|
||||||
while(parent.firstChild !== links) {
|
while (parent.firstChild !== container) {
|
||||||
parent.insertBefore(parent.removeChild(parent.firstChild), sib);
|
parent.insertBefore(parent.removeChild(parent.firstChild), sib);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -198,7 +198,8 @@
|
||||||
}
|
}
|
||||||
//textbox.inputField.scrollTop = scrollPos;
|
//textbox.inputField.scrollTop = scrollPos;
|
||||||
|
|
||||||
this._id('linksbox').hidden = !(this.displayTags && this.displayRelated);
|
this._id('links-container').hidden = !(this.displayTags && this.displayRelated);
|
||||||
|
this._id('links-box').refresh();
|
||||||
|
|
||||||
if (this.keyDownHandler) {
|
if (this.keyDownHandler) {
|
||||||
textbox.setAttribute('onkeydown',
|
textbox.setAttribute('onkeydown',
|
||||||
|
@ -359,8 +360,8 @@
|
||||||
timeout="1000" flex="1" hidden="true"/>
|
timeout="1000" flex="1" hidden="true"/>
|
||||||
<xul:textbox id="noteFieldReadOnly" type="styled" mode="note"
|
<xul:textbox id="noteFieldReadOnly" type="styled" mode="note"
|
||||||
readonly="true" flex="1" hidden="true"/>
|
readonly="true" flex="1" hidden="true"/>
|
||||||
<xul:hbox id="linksbox" hidden="true">
|
<xul:hbox id="links-container" hidden="true">
|
||||||
<xul:linksbox id="links" flex="1" xbl:inherits="notitle"/>
|
<xul:linksbox id="links-box" flex="1" xbl:inherits="notitle"/>
|
||||||
</xul:hbox>
|
</xul:hbox>
|
||||||
<xul:button id="goButton" hidden="true"/>
|
<xul:button id="goButton" hidden="true"/>
|
||||||
</xul:vbox>
|
</xul:vbox>
|
||||||
|
@ -377,9 +378,8 @@
|
||||||
this.itemRef = val;
|
this.itemRef = val;
|
||||||
|
|
||||||
this.id('tags').item = this.item;
|
this.id('tags').item = this.item;
|
||||||
this.updateTagsSummary();
|
|
||||||
this.id('related').item = this.item;
|
this.id('related').item = this.item;
|
||||||
this.updateRelatedSummary();
|
this.refresh();
|
||||||
]]>
|
]]>
|
||||||
</setter>
|
</setter>
|
||||||
</property>
|
</property>
|
||||||
|
@ -412,14 +412,20 @@
|
||||||
</property>
|
</property>
|
||||||
<method name="tagsClick">
|
<method name="tagsClick">
|
||||||
<body><![CDATA[
|
<body><![CDATA[
|
||||||
Zotero.spawn(function* () {
|
this.id('tags').reload();
|
||||||
yield this.id('tags').reload();
|
var x = this.boxObject.screenX;
|
||||||
var x = this.boxObject.screenX;
|
var y = this.boxObject.screenY;
|
||||||
var y = this.boxObject.screenY;
|
this.id('tagsPopup').openPopupAtScreen(x, y, false);
|
||||||
this.id('tagsPopup').openPopupAtScreen(x, y, false);
|
|
||||||
}, this);
|
|
||||||
]]></body>
|
]]></body>
|
||||||
</method>
|
</method>
|
||||||
|
|
||||||
|
<method name="refresh">
|
||||||
|
<body><![CDATA[
|
||||||
|
this.updateTagsSummary();
|
||||||
|
this.updateRelatedSummary();
|
||||||
|
]]></body>
|
||||||
|
</method>
|
||||||
|
|
||||||
<method name="updateTagsSummary">
|
<method name="updateTagsSummary">
|
||||||
<body><![CDATA[
|
<body><![CDATA[
|
||||||
var v = this.id('tags').summary;
|
var v = this.id('tags').summary;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user