crazedsanity / cs-battletrack

PHP-Based web application for tracking data in traditional paper-and-pencil role playing games.
http://www.crazedsanity.com/projects/cs-battletrack
Other
1 stars 1 forks source link

Creating a new record creates multiples #35

Closed crazedsanity closed 10 years ago

crazedsanity commented 10 years ago

Creating the first weapon works normally. Creating a second (possibly only after not reloading) causes three additional copies of the item to appear.

crazedsanity commented 10 years ago

It seems there's a duplication problem when adding different types multiple times. Recreation:

  1. create new weapon: one record (OK)
  2. create new feat: one record (OK)
  3. create new weapon: two records (FAIL)
  4. create new feat: two records (FAIL)
  5. create new gear: one record (OK)
  6. create new weapon: THREE records (FAIL)
  7. create new feat: THREE records (FAIL)
  8. create new gear: THREE records (FAIL)

It has everything to do with the javascript & timing. In testing (on the branch issue_37), I fixed this by removing the code calling submitNewRecordDialog(this) and put it into the onClick property on the template's HTML directly. No duplication after that.

crazedsanity commented 10 years ago

Seems to be fixed in v0.9.0. Interesting to note, however, that the input in the dialog now changes colors (marked as dirty, then as being updated).