add destroy method for inputs

This commit is contained in:
vitalets 2013-06-15 16:55:04 +04:00
parent ef6151ff15
commit 8287173d26
3 changed files with 9 additions and 0 deletions

@ -3,6 +3,7 @@ X-editable changelog
Version 1.4.5 wip
----------------------------
[enh] add `destroy` method to inputs (vitalets)
[enh #164] allow emptytext to be html (vitalets)
[enh #78] allow html in editable content (vitalets)
[enh] update container position when datetimepicker viewMode changes (vitalets)

@ -448,6 +448,8 @@ Makes editable any HTML element on the page. Applied as jQuery method.
if(this.container) {
this.container.destroy();
}
this.input.destroy();
if(this.options.toggle !== 'manual') {
this.$element.removeClass('editable-click');

@ -152,6 +152,12 @@ To create your own input you can inherit from this class.
},
/**
Additional actions when destroying element
**/
destroy: function() {
},
// -------- helper functions --------
setClass: function() {
if(this.options.inputclass) {