vitalets / angular-xeditable

Edit in place for AngularJS
http://vitalets.github.io/angular-xeditable
MIT License
1.91k stars 403 forks source link

no buttons => cancel on blur #545

Closed wetternest closed 7 years ago

wetternest commented 8 years ago

https://github.com/vitalets/angular-xeditable/blob/master/src/js/editable-element/controller.js#L271

why am i not allowed to set buttons='no' AND blurElem='submit' via config? how are user supposed to submit then? (i know that i can override this option for every editable with the attribute blur="submit", but this option seems not very practical....)

ckosloski commented 7 years ago

Not sure what issue you are having, but you can set both buttons and blurElem in the config options, see the documentation.

wetternest commented 7 years ago

setting buttons = 'no' deactivates editableOptions.blurElem self.editorEl.attr('blur', self.attrs.blur || (self.buttons === 'no' ? 'cancel' : editableOptions.blurElem));

see code at https://github.com/vitalets/angular-xeditable/blob/master/src/js/editable-element/controller.js#L283

shure one can set self.attrs.blur for every element, but setting this in the editableOptions for all elements at once would be much more convenient!

ckosloski commented 7 years ago

What do you think that line of code should be in order for both to work together?

ckosloski commented 7 years ago

@wetternest this should be fixed now, can you retest.

wetternest commented 7 years ago

thank you for your fix! i will test it as soon as possible, unfortunately i don’t have much time at the moment =(

ckosloski commented 7 years ago

@eugef please close, this issue is fixed.