Browse Source

Pull request #2422: chore: 整理代码

Merge in VISUAL/fineui from ~GUY/fineui:master to master

* commit 'c4c747d67ac324529e7a356c09aedfd675e5c155':
  chore: 整理代码
  chore: 整理代码
es6
guy 3 years ago
parent
commit
e1d7cbd20e
  1. 8
      src/base/combination/combo.js

8
src/base/combination/combo.js

@ -1,5 +1,6 @@
!(function () {
var needHideWhenAnotherComboOpen = {};
var currentOpenedCombo;
/**
* @class BI.Combo
* @extends BI.Widget
@ -141,6 +142,7 @@
this.element.removeClass(this.options.comboClass);
delete needHideWhenAnotherComboOpen[this.getName()];
currentOpenedCombo = null;
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.EVENT_BLUR && o.hideWhenBlur && BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName());
@ -161,6 +163,7 @@
}
}
});
!this.options.hideWhenAnotherComboOpen && (currentOpenedCombo = this);
this.options.hideWhenAnotherComboOpen && (needHideWhenAnotherComboOpen[this.getName()] = this);
this.adjustWidth(e);
this.adjustHeight(e);
@ -300,14 +303,19 @@
BI.Resizers.remove(this.getName());
this.popupView && this.popupView._destroy();
delete needHideWhenAnotherComboOpen[this.getName()];
if (currentOpenedCombo === this) {
currentOpenedCombo = null;
}
}
});
BI.Combo.closeAll = function () {
currentOpenedCombo && currentOpenedCombo.hideView();
BI.each(needHideWhenAnotherComboOpen, function (i, combo) {
if (combo) {
combo.hideView();
}
});
currentOpenedCombo = null;
needHideWhenAnotherComboOpen = {};
};
BI.Combo.EVENT_TRIGGER_CHANGE = "EVENT_TRIGGER_CHANGE";

Loading…
Cancel
Save