commit 3bd954e3da8528600f96733cddbbc00511c88e93
parent 53bd9afeacdb4ef9017449ecab05ee4af7dac38b
Author: Dan Stillman <dstillman@zotero.org>
Date: Sun, 9 Aug 2009 23:51:54 +0000
Don't show Add and remove buttons for read-only tags
Diffstat:
1 file changed, 21 insertions(+), 13 deletions(-)
diff --git a/chrome/content/zotero/bindings/tagsbox.xml b/chrome/content/zotero/bindings/tagsbox.xml
@@ -107,6 +107,9 @@
<![CDATA[
Zotero.debug('Reloading tags');
+ var addButton = this.id('addButton');
+ addButton.hidden = !this.editable;
+
var rows = this.id('tagRows');
while(rows.hasChildNodes())
rows.removeChild(rows.firstChild);
@@ -174,23 +177,27 @@
var label = this.createValueElement(name, tabindex);
- var remove = document.createElement("label");
- remove.setAttribute('value','-');
- remove.setAttribute('class','zotero-clicky');
- if (tagID)
- {
- remove.setAttribute('ztabindex', -1);
- remove.setAttribute('onclick',"document.getBindingParent(this).remove('"+ tagID +"');");
- }
- else
- {
- remove.setAttribute('disabled', true);
+ if (this.editable) {
+ var remove = document.createElement("label");
+ remove.setAttribute('value','-');
+ remove.setAttribute('class','zotero-clicky');
+ if (tagID)
+ {
+ remove.setAttribute('ztabindex', -1);
+ remove.setAttribute('onclick',"document.getBindingParent(this).remove('"+ tagID +"');");
+ }
+ else
+ {
+ remove.setAttribute('disabled', true);
+ }
}
var row = document.createElement("row");
row.appendChild(icon);
row.appendChild(label);
- row.appendChild(remove);
+ if (this.editable) {
+ row.appendChild(remove);
+ }
if (tagID)
{
@@ -694,8 +701,9 @@
<xul:scrollbox xbl:inherits="flex" orient="vertical" style="overflow:auto">
<xul:hbox align="center">
<xul:label id="tagsNum"/>
- <xul:button label="&zotero.item.add;" oncommand="document.getBindingParent(this).new();"/>
+ <xul:button id="addButton" label="&zotero.item.add;" oncommand="document.getBindingParent(this).new();" hidden="true"/>
</xul:hbox>
+ <xul:separator class="thin"/>
<xul:grid>
<xul:columns>
<xul:column/>