Clear highlight on backspace.
This commit is contained in:
parent
b46227fc5f
commit
d16cf5f3da
|
@ -600,6 +600,7 @@
|
||||||
if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
|
if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
|
||||||
return this.keydown_backstroke();
|
return this.keydown_backstroke();
|
||||||
} else if (!this.pending_backstroke) {
|
} else if (!this.pending_backstroke) {
|
||||||
|
this.result_clear_highlight();
|
||||||
return this.results_search();
|
return this.results_search();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -608,6 +608,7 @@
|
||||||
if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
|
if (this.is_multiple && this.backstroke_length < 1 && this.choices > 0) {
|
||||||
return this.keydown_backstroke();
|
return this.keydown_backstroke();
|
||||||
} else if (!this.pending_backstroke) {
|
} else if (!this.pending_backstroke) {
|
||||||
|
this.result_clear_highlight();
|
||||||
return this.results_search();
|
return this.results_search();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -649,13 +650,14 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
Chosen.prototype.search_field_scale = function() {
|
Chosen.prototype.search_field_scale = function() {
|
||||||
var dd_top, div, h, style, style_block, styles, w;
|
var dd_top, div, h, style, style_block, styles, w, _i, _len;
|
||||||
if (this.is_multiple) {
|
if (this.is_multiple) {
|
||||||
h = 0;
|
h = 0;
|
||||||
w = 0;
|
w = 0;
|
||||||
style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
|
style_block = "position:absolute; left: -1000px; top: -1000px; display:none;";
|
||||||
styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
|
styles = ['font-size', 'font-style', 'font-weight', 'font-family', 'line-height', 'text-transform', 'letter-spacing'];
|
||||||
for (style in styles) {
|
for (_i = 0, _len = styles.length; _i < _len; _i++) {
|
||||||
|
style = styles[_i];
|
||||||
style_block += style + ":" + this.search_field.getStyle(style) + ";";
|
style_block += style + ":" + this.search_field.getStyle(style) + ";";
|
||||||
}
|
}
|
||||||
div = new Element('div', {
|
div = new Element('div', {
|
||||||
|
|
|
@ -531,6 +531,7 @@ class Chosen
|
||||||
if @is_multiple and @backstroke_length < 1 and @choices > 0
|
if @is_multiple and @backstroke_length < 1 and @choices > 0
|
||||||
this.keydown_backstroke()
|
this.keydown_backstroke()
|
||||||
else if not @pending_backstroke
|
else if not @pending_backstroke
|
||||||
|
this.result_clear_highlight()
|
||||||
this.results_search()
|
this.results_search()
|
||||||
when 13
|
when 13
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
|
|
|
@ -516,6 +516,7 @@ class Chosen
|
||||||
if @is_multiple and @backstroke_length < 1 and @choices > 0
|
if @is_multiple and @backstroke_length < 1 and @choices > 0
|
||||||
this.keydown_backstroke()
|
this.keydown_backstroke()
|
||||||
else if not @pending_backstroke
|
else if not @pending_backstroke
|
||||||
|
this.result_clear_highlight()
|
||||||
this.results_search()
|
this.results_search()
|
||||||
when 13
|
when 13
|
||||||
evt.preventDefault()
|
evt.preventDefault()
|
||||||
|
|
Loading…
Reference in a new issue