Keep active item pane editing field open when window loses focus

Closes #153
This commit is contained in:
Dan Stillman 2014-12-26 14:16:41 -05:00
parent d82f8e91dc
commit 0b3b296e28

View file

@ -1467,9 +1467,24 @@
t.select();
// Leave text field open when window loses focus
var ignoreBlur = function () {
this.ignoreBlur = true;
}.bind(this);
var unignoreBlur = function () {
this.ignoreBlur = false;
}.bind(this);
addEventListener("deactivate", ignoreBlur);
addEventListener("activate", unignoreBlur);
t.addEventListener('blur', function () {
document.getBindingParent(this).blurHandler(this);
}, false);
var self = document.getBindingParent(this);
if (self.ignoreBlur) return;
removeEventListener("deactivate", ignoreBlur);
removeEventListener("activate", unignoreBlur);
self.blurHandler(this);
});
t.setAttribute('onkeypress', "return document.getBindingParent(this).handleKeyPress(event)");
this._tabDirection = false;