Commit 705c578b authored by Julia Radzhabova's avatar Julia Radzhabova

Debug input to fonts combobox (fast input).

parent c2f4b491
...@@ -158,25 +158,31 @@ define([ ...@@ -158,25 +158,31 @@ define([
this.selectCandidate(e.keyCode == Common.UI.Keys.DELETE || e.keyCode == Common.UI.Keys.BACKSPACE); this.selectCandidate(e.keyCode == Common.UI.Keys.DELETE || e.keyCode == Common.UI.Keys.BACKSPACE);
if (this._selectedItem) { if (this._selectedItem) {
var me = this; var me = this;
setTimeout(function() { if (me._timerSelection===undefined)
var input = me._input[0], me._timerSelection = setInterval(function(){
text = me._selectedItem.get(me.displayField), if ((new Date()) - me._inInputKeyDown<100 || !me._selectedItem) return;
inputVal = input.value;
if (me.rendered) { clearInterval(me._timerSelection);
if (document.selection) { // IE me._timerSelection = undefined;
document.selection.createRange().text = text; var input = me._input[0],
} else if (input.selectionStart || input.selectionStart == '0') { //FF и Webkit text = me._selectedItem.get(me.displayField),
input.value = text; inputVal = input.value;
input.selectionStart = inputVal.length; if (me.rendered) {
input.selectionEnd = text.length; if (document.selection) { // IE
document.selection.createRange().text = text;
} else if (input.selectionStart || input.selectionStart == '0') { //FF и Webkit
input.value = text;
input.selectionStart = inputVal.length;
input.selectionEnd = text.length;
}
} }
} }, 10);
}, 10);
} }
} }
}, },
onInputKeyDown: function(e) { onInputKeyDown: function(e) {
this._inInputKeyDown = (new Date());
var me = this; var me = this;
if (e.keyCode == Common.UI.Keys.ESC){ if (e.keyCode == Common.UI.Keys.ESC){
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment