Add progress indicator to add item by identifier
This commit is contained in:
parent
376ecba496
commit
865b3e0b21
2 changed files with 18 additions and 3 deletions
|
@ -58,6 +58,9 @@ const Zotero_Lookup = new function () {
|
||||||
translate.setTranslator(translators);
|
translate.setTranslator(translators);
|
||||||
|
|
||||||
translate.setHandler("done", function(translate, success) {
|
translate.setHandler("done", function(translate, success) {
|
||||||
|
identifierElement.style.opacity = 1;
|
||||||
|
identifierElement.disabled = false;
|
||||||
|
document.getElementById("zotero-lookup-progress").hidden = true;
|
||||||
if(success) {
|
if(success) {
|
||||||
document.getElementById("zotero-lookup-panel").hidePopup();
|
document.getElementById("zotero-lookup-panel").hidePopup();
|
||||||
} else {
|
} else {
|
||||||
|
@ -78,6 +81,10 @@ const Zotero_Lookup = new function () {
|
||||||
if(collection) collection.addItem(item.id);
|
if(collection) collection.addItem(item.id);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
identifierElement.style.opacity = 0.5;
|
||||||
|
identifierElement.disabled = true;
|
||||||
|
document.getElementById("zotero-lookup-progress").hidden = false;
|
||||||
|
|
||||||
translate.translate(libraryID);
|
translate.translate(libraryID);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -102,7 +109,12 @@ const Zotero_Lookup = new function () {
|
||||||
if(!Zotero.isFx4) {
|
if(!Zotero.isFx4) {
|
||||||
document.getElementById("zotero-lookup-panel").style.padding = "10px";
|
document.getElementById("zotero-lookup-panel").style.padding = "10px";
|
||||||
}
|
}
|
||||||
document.getElementById("zotero-lookup-textbox").focus();
|
|
||||||
|
document.getElementById("zotero-lookup-progress").hidden = false;
|
||||||
|
var identifierElement = document.getElementById("zotero-lookup-textbox");
|
||||||
|
identifierElement.style.opacity = 1;
|
||||||
|
identifierElement.disabled = false;
|
||||||
|
identifierElement.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -142,10 +142,13 @@
|
||||||
<toolbarbutton id="zotero-tb-item-from-page" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newItemFromPage.label;" command="cmd_zotero_newItemFromCurrentPage"/>
|
<toolbarbutton id="zotero-tb-item-from-page" class="zotero-tb-button" tooltiptext="&zotero.toolbar.newItemFromPage.label;" command="cmd_zotero_newItemFromCurrentPage"/>
|
||||||
<toolbarbutton id="zotero-tb-lookup" class="zotero-tb-button" tooltiptext="&zotero.toolbar.lookup.label;" type="panel">
|
<toolbarbutton id="zotero-tb-lookup" class="zotero-tb-button" tooltiptext="&zotero.toolbar.lookup.label;" type="panel">
|
||||||
<panel id="zotero-lookup-panel" type="arrow" onpopupshown="Zotero_Lookup.onShowing()"
|
<panel id="zotero-lookup-panel" type="arrow" onpopupshown="Zotero_Lookup.onShowing()"
|
||||||
onpopuphidden="Zotero_Lookup.onHidden()" noautohide="true">
|
onpopuphidden="Zotero_Lookup.onHidden()">
|
||||||
<vbox>
|
<vbox>
|
||||||
<description>&zotero.lookup.description;</description>
|
<description>&zotero.lookup.description;</description>
|
||||||
<textbox id="zotero-lookup-textbox" style="margin: 2px 0 2px 0" onkeypress="return Zotero_Lookup.onKeyPress(event)" flex="1"/>
|
<stack>
|
||||||
|
<progressmeter id="zotero-lookup-progress" mode="undetermined" hidden="true"/>
|
||||||
|
<textbox id="zotero-lookup-textbox" onkeypress="return Zotero_Lookup.onKeyPress(event)" flex="1"/>
|
||||||
|
</stack>
|
||||||
</vbox>
|
</vbox>
|
||||||
</panel>
|
</panel>
|
||||||
</toolbarbutton>
|
</toolbarbutton>
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue