Catch input directly, open pulldown later.

This commit is contained in:
Martin Edenhofer 2014-12-04 21:40:12 +01:00
parent 7460980545
commit 6fe045924d

View file

@ -113,7 +113,6 @@
// build buffer // build buffer
this.$element.on('keypress', $.proxy(function (e) { this.$element.on('keypress', $.proxy(function (e) {
console.log('BUFF', this.buffer, e.keyCode, String.fromCharCode(e.which) ) console.log('BUFF', this.buffer, e.keyCode, String.fromCharCode(e.which) )
a = $.proxy(function() {
// shift // shift
if ( e.keyCode === 16 ) { if ( e.keyCode === 16 ) {
@ -144,15 +143,16 @@
} }
console.log('BUFF HINT', this.buffer, this.buffer.length, e.which, String.fromCharCode(e.which)) console.log('BUFF HINT', this.buffer, this.buffer.length, e.which, String.fromCharCode(e.which))
b = $.proxy(function() {
this.result( this.buffer.substr(2,this.buffer.length) ) this.result( this.buffer.substr(2,this.buffer.length) )
}, this)
setTimeout(b, 400);
if (!this.isActive()) { if (!this.isActive()) {
this.open() this.open()
} }
} }
}, this)
setTimeout(a, 400);
}, this)).on('focus', $.proxy(function (e) { }, this)).on('focus', $.proxy(function (e) {
this.close() this.close()
@ -191,7 +191,10 @@
if (this.ce) { if (this.ce) {
this.ce.input('off') this.ce.input('off')
} }
b = $.proxy(function() {
this.$widget.addClass('open') this.$widget.addClass('open')
}, this)
setTimeout(b, 400);
} }
// close widget // close widget