Browse Source

Pull request #2316: 无JIRA任务 回滚到原来

Merge in VISUAL/fineui from ~WINDY/fui:master to master

* commit 'a3161038d90bfe5d02cebb21b45183c2f22e0cd1':
  无JIRA任务 回滚到原来
es6
Kara 3 years ago
parent
commit
d70ddffef7
  1. 11
      src/base/single/input/input.js

11
src/base/single/input/input.js

@ -24,7 +24,7 @@ BI.Input = BI.inherit(BI.Single, {
var _keydown = BI.debounce(function (keyCode) { var _keydown = BI.debounce(function (keyCode) {
self.onKeyDown(keyCode, ctrlKey); self.onKeyDown(keyCode, ctrlKey);
self._keydown_ = false; self._keydown_ = false;
}, BI.EVENT_RESPONSE_TIME); }, 300);
var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, { var _clk = BI.debounce(BI.bind(this._click, this), BI.EVENT_RESPONSE_TIME, {
"leading": true, "leading": true,
"trailing": false "trailing": false
@ -33,7 +33,10 @@ BI.Input = BI.inherit(BI.Single, {
"leading": true, "leading": true,
"trailing": false "trailing": false
}); });
this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME); this._blurDebounce = BI.debounce(BI.bind(this._blur, this), BI.EVENT_RESPONSE_TIME, {
"leading": true,
"trailing": false
});
this.element this.element
.keydown(function (e) { .keydown(function (e) {
inputEventValid = false; inputEventValid = false;
@ -92,7 +95,11 @@ BI.Input = BI.inherit(BI.Single, {
_blur: function () { _blur: function () {
var self = this; var self = this;
if (self._keydown_ === true) {
BI.delay(blur, 300);
} else {
blur(); blur();
}
function blur () { function blur () {
if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) { if (!self.isValid() && self.options.quitChecker.apply(self, [BI.trim(self.getValue())]) !== false) {

Loading…
Cancel
Save