#179 closed defect (fixed)
adding a new creator then clicking an existing creator makes the creator field disappear
| Reported by: | simon | Owned by: | dstillman |
|---|---|---|---|
| Priority: | blocker | Milestone: | 1.0 Beta 1 |
| Component: | interface | Version: | 1.0 |
| Keywords: | Cc: | david |
Description
if you click the plus sign to add a new creator, then click the name of an existing creator, the blank creator you just added disappears and the existing creator does not become editable.
Change History (7)
comment:1 Changed 10 years ago by dstillman
- Priority changed from minor to major
comment:2 Changed 10 years ago by simon
it also happens when you try to change the creator type...and it keeps happening! definitely something that needs to be fixed before we send this out to people. dan, do you want to take a shot at it, or should i?
comment:3 Changed 10 years ago by simon
and in related news, if the first name field is blank, and you put something in it, it resets the creator type. also, when you click off of a field to change the creator type, the field should still save. (right now it erases the field contents.)
comment:4 Changed 10 years ago by dstillman
- Cc david added
- Owner changed from david to dstillman
- Priority changed from major to blocker
- Status changed from new to assigned
comment:5 Changed 10 years ago by dstillman
- Resolution set to fixed
- Status changed from assigned to closed
(In [483]) Fixes #179, adding a new creator then clicking an existing creator makes the creator field disappear
Fixed a number of creator-editing-related issues (mostly interface-side, with a little help from the data layer):
- New row no longer disappears when clicking "+" and then clicking the existing or new creator (removed onselect="ScholarItemPane.loadPane(this.selectedIndex)" on the <deck> (from r371, with changelog "Individual tabs don't load their content unless selected"), which doesn't seem to be necessary as far as I can tell)
- New row no longer disappears when changing creator before editing names (setting the creator type now triggers an Item.save() with an otherwise blank creator (now allowed by the data layer), which isn't entirely ideal but is probably OK for now)
- Clicking the minus button on an unsaved row (i.e. one just created with the plus button) no longer throws an error (new method Item.hasCreatorAt(pos), and ScholarItemPane.removeCreator() just deletes the label directly, since it doesn't get a notify() event to reload the pane)
- The plus button is disabled on unsaved rows, since allowing the user to create multiple unsaved rows and then edit one in the middle is problematic (and the other alternatives have their own problems); the minus button is also disabled on the default row that shows when there are no creators
- Creator type is no longer reset when editing a name field
- Name field is no longer erased when clicking directly on creator type popup and changing creator type without blurring textbox
- Comma is appended to last name when switching from <textbox> to <label> without saving changes (before it was just appended to labels when the pane was loaded)
comment:6 Changed 10 years ago by dstillman
(In [492]) Unsaved creators are no longer saved (e.g. on creator type change) if they don't have a firstName or a lastName
(Also fixes bug from r379 where changing creator type on a blank unsaved creator would actually insert "(first)" and "(last)")
Localized '(first)' and '(last)'
Refs #179, adding a new creator then clicking an existing creator makes the creator field disappear
comment:7 Changed 10 years ago by dstillman
(In [522]) 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
Upgrading to major, since this also happens when clicking the plus sign and then clicking "(last)" or "(first)" to edit the new one. Note that this only happens the first time you do it in an editing pane--after the first time, you have to click to another source and back to get it to reoccur.