clear link in date input

This commit is contained in:
vitalets
2012-11-26 13:36:29 +04:00
parent 999bbe25df
commit 2438ea8da1
7 changed files with 89 additions and 9 deletions

@@ -18,6 +18,7 @@ To create your own input you should inherit from this class.
this.type = type;
this.options = $.extend({}, defaults, options);
this.$input = null;
this.$clear = null;
this.error = null;
},
@@ -28,14 +29,13 @@ To create your own input you should inherit from this class.
**/
render: function() {
this.$input = $(this.options.tpl);
this.$input.addClass('editable-input');
if(this.options.inputclass) {
this.$input.addClass(this.options.inputclass);
}
if (this.options.placeholder) {
this.$input.attr('placeholder', this.options.placeholder);
}
}
},
/**
@@ -111,6 +111,15 @@ To create your own input you should inherit from this class.
if(this.$input.is(':visible')) {
this.$input.focus();
}
},
/**
Creares input.
@method clear()
**/
clear: function() {
this.$input.val(null);
}
};