one for fix for clear option keypup handler
This commit is contained in:
@ -44,8 +44,20 @@ $(function(){
|
|||||||
if (this.options.clear) {
|
if (this.options.clear) {
|
||||||
this.$clear = $('<span class="editable-clear-x"></span>');
|
this.$clear = $('<span class="editable-clear-x"></span>');
|
||||||
this.$input.after(this.$clear)
|
this.$input.after(this.$clear)
|
||||||
.css('padding-right', 20)
|
.css('padding-right', 24)
|
||||||
.keyup($.proxy(this.toggleClear, this))
|
.keyup($.proxy(function(e) {
|
||||||
|
//arrows, enter, tab, etc
|
||||||
|
if(~$.inArray(e.keyCode, [40,38,9,13,27])) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
clearTimeout(this.t);
|
||||||
|
var that = this;
|
||||||
|
this.t = setTimeout(function() {
|
||||||
|
that.toggleClear(e);
|
||||||
|
}, 200);
|
||||||
|
|
||||||
|
}, this))
|
||||||
.parent().css('position', 'relative');
|
.parent().css('position', 'relative');
|
||||||
|
|
||||||
this.$clear.click($.proxy(this.clear, this));
|
this.$clear.click($.proxy(this.clear, this));
|
||||||
@ -73,11 +85,6 @@ $(function(){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
//arrows, enter, tab, etc
|
|
||||||
if(~$.inArray(e.keyCode, [40,38,9,13,27])) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
var len = this.$input.val().length,
|
var len = this.$input.val().length,
|
||||||
visible = this.$clear.is(':visible');
|
visible = this.$clear.is(':visible');
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user