yields / editable-placeholder

Editable placeholder a la medium.com
6 stars 4 forks source link

Is possible bind events callbacks after/before start to editing? #7

Open vmariano opened 10 years ago

vmariano commented 10 years ago

Yeah, that. I try to save data, when the user finish the edition. I think a possible handle callbacks in each state.

yields commented 10 years ago

sounds good to me, maybe before edit, after edit events using emitter could help ?

vmariano commented 10 years ago

At the begining I thinking in something like

var options = {
  afterEdit: function () {
    ...
  },
  beforeEdit: function () {
    ...
  }
}

placeholder(el, 'type here',options)

But with emmiter souns good too. Do you suggest a namespace for name emmiter events?

yields commented 10 years ago

@vmariano i think just emit('before edit'), emit('after edit') would be good :)