OK, I think this should fix both #179 ("adding a new creator then clicking an existing creator makes the creator field disappear") and #190 ("tag issues") -- I caused #190 with my fix to the former, and David rebroke #179 with his revert to fix the latter.
The problem was twofold: 1) onselect="ScholarItemPane.loadPane(this.selectedIndex)" is (for some reason) triggered when clicking off of the "+" creator add button onto the rest of the deck pane (and not just when switching tabs) and 2) the selectedIndex passed into loadPane() from the deck during the non-tab triggers is (for some reason) an empty string rather than the index of the selected tab, which is why the creator problem only used to happen the first time you clicked away from a "+" (before the empty string was stored as a key in the _loaded array). (In short, onselect for decks is pretty broken.) Now only calling loadPane if (this.selectedIndex!=='') -- can't just test for typeof=='number' because this.selectedIndex on the deck is always a string refs #179 and #190
This commit is contained in:
parent
c4e9e76795
commit
57f4e43507
2 changed files with 4 additions and 2 deletions
|
@ -90,7 +90,7 @@ ScholarItemPane = new function()
|
|||
{
|
||||
_itemBeingEdited = thisItem;
|
||||
|
||||
_loaded = new Array(5);
|
||||
_loaded = {};
|
||||
|
||||
loadPane(_tabs.selectedIndex);
|
||||
}
|
||||
|
@ -99,7 +99,9 @@ ScholarItemPane = new function()
|
|||
{
|
||||
//Scholar.debug('Loading item pane ' + index);
|
||||
if(_loaded[index])
|
||||
{
|
||||
return;
|
||||
}
|
||||
_loaded[index] = true;
|
||||
|
||||
// Info pane
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
|
||||
|
||||
<script src="itemPane.js"/>
|
||||
<deck id="scholar-view-item" flex="1" onselect="ScholarItemPane.loadPane(this.selectedIndex)">
|
||||
<deck id="scholar-view-item" flex="1" onselect="if (this.selectedIndex!==''){ ScholarItemPane.loadPane(this.selectedIndex) }">
|
||||
<vbox id="scholar-info" flex="1">
|
||||
<popupset>
|
||||
<popup id="creatorTypeMenu" position="after_start"
|
||||
|
|
Loading…
Reference in a new issue