diff --git a/chrome/chromeFiles/content/scholar/customControls.xml b/chrome/chromeFiles/content/scholar/customControls.xml index bebbff150..196231d92 100644 --- a/chrome/chromeFiles/content/scholar/customControls.xml +++ b/chrome/chromeFiles/content/scholar/customControls.xml @@ -195,10 +195,10 @@ - + - + @@ -212,6 +212,7 @@ @@ -291,7 +292,6 @@ if(t && this.item) { this.item.addTag(t); - this.parentNode.parentNode.parentNode.parentNode.updateTagsSummary(); } ]]> @@ -360,6 +360,7 @@ @@ -443,7 +444,6 @@ { this.item.addSeeAlso(io.dataOut[i]); } - this.parentNode.parentNode.parentNode.parentNode.updateSeeAlsoSummary(); } ]]> diff --git a/chrome/chromeFiles/content/scholar/itemPane.js b/chrome/chromeFiles/content/scholar/itemPane.js index 9cfd2ab54..59912721e 100644 --- a/chrome/chromeFiles/content/scholar/itemPane.js +++ b/chrome/chromeFiles/content/scholar/itemPane.js @@ -9,10 +9,13 @@ ScholarItemPane = new function() var _creatorCount; + var _loaded; + var _itemBeingEdited; this.onLoad = onLoad; this.viewItem = viewItem; + this.loadPane = loadPane; this.changeTypeTo = changeTypeTo; this.addCreatorRow = addCreatorRow; this.removeCreator = removeCreator; @@ -25,12 +28,14 @@ ScholarItemPane = new function() function onLoad() { + _tabs = document.getElementById('scholar-view-tabs'); _dynamicFields = document.getElementById('editpane-dynamic-fields'); _itemTypeMenu = document.getElementById('editpane-type-menu'); _creatorTypeMenu = document.getElementById('creatorTypeMenu'); _notesList = document.getElementById('editpane-dynamic-notes'); _notesLabel = document.getElementById('editpane-notes-label'); - _linksBox = document.getElementById('editpane-links'); + _tagsBox = document.getElementById('editpane-tags'); + _relatedBox = document.getElementById('editpane-related'); var creatorTypes = Scholar.CreatorTypes.getTypes(); for(var i = 0; i < creatorTypes.length; i++) @@ -58,91 +63,118 @@ ScholarItemPane = new function() { _itemBeingEdited = thisItem; - reloadFields(); + _loaded = new Array(5); + + loadPane(_tabs.selectedIndex); } - function reloadFields() + function loadPane(index) { - while(_dynamicFields.hasChildNodes()) - _dynamicFields.removeChild(_dynamicFields.firstChild); + if(_loaded[index]) + return; + _loaded[index] = true; - for(var i = 0, len = _itemTypeMenu.firstChild.childNodes.length; i < len; i++) - if(_itemTypeMenu.firstChild.childNodes[i].value == _itemBeingEdited.getType()) - _itemTypeMenu.selectedIndex = i; - - var fieldNames = new Array("title","dateAdded","dateModified"); - var fields = Scholar.ItemFields.getItemTypeFields(_itemBeingEdited.getField("itemTypeID")); - for(var i = 0; i 0) - { - for(var i = 0, len=_itemBeingEdited.numCreators(); i 0) + { + for(var i = 0, len=_itemBeingEdited.numCreators(); i