indexiatech / ember-idx-modal

Ember Indexia Modal
http://indexiatech.github.io/ember-idx-modal/#/gettingstarted
Apache License 2.0
17 stars 13 forks source link

Added reset of submission #17

Closed joshpfosi closed 8 years ago

joshpfosi commented 9 years ago

Hi,

I was using your modals for what I think is a common use case: Editing and creating certain models in the same form. However, a bug occurs from the following sequence:

  1. Edit an existing model.
  2. Submit (setting submitted true on the ember-forms component)
  3. Create new model (setting model of modal=this.store.createRecord('model'))
  4. Cancel without saving

As implemented the submitted boolean is still true, even though the form hasn't been submitted. I propose a simple and semantic bug fix. As I understand it, submitted is used to ensure that the on-cancel event is triggered if necessary. Once its been triggered, the boolean should be reset to maintain the invariant that it represents the submit status of the current modal. Please agree so I don't have to use a forked version of this otherwise great plugin!

joshpfosi commented 9 years ago

Is this project under active development?