Browse Source

combo增加blur事件

es6
guy 3 years ago
parent
commit
6992b30312
  1. 2
      changelog.md
  2. 7
      src/base/combination/combo.js

2
changelog.md

@ -1,4 +1,6 @@
# 更新日志 # 更新日志
2.0(2021-100)
- combo增加window.blur事件触发隐藏
2.0(2021-09) 2.0(2021-09)
- 支持自动watch - 支持自动watch
- 支持h函数传递left、right,优化left_right_vertical_adapt布局的jsx写法 - 支持h函数传递left、right,优化left_right_vertical_adapt布局的jsx写法

7
src/base/combination/combo.js

@ -308,6 +308,7 @@
delete needHideWhenAnotherComboOpen[this.getName()]; delete needHideWhenAnotherComboOpen[this.getName()];
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName());
this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_HIDEVIEW);
}, },
@ -331,7 +332,10 @@
this.element.addClass(this.options.comboClass); this.element.addClass(this.options.comboClass);
BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName()); BI.Widget._renderEngine.createElement(document).unbind("mousedown." + this.getName()).unbind("mousewheel." + this.getName());
BI.Widget._renderEngine.createElement(window).unbind("blur." + this.getName());
BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this)); BI.Widget._renderEngine.createElement(document).bind("mousedown." + this.getName(), BI.bind(this._hideIf, this)).bind("mousewheel." + this.getName(), BI.bind(this._hideIf, this));
BI.Widget._renderEngine.createElement(window).bind("blur." + this.getName(), BI.bind(this._hideIf, this));
this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW); this.fireEvent(BI.Combo.EVENT_AFTER_POPUPVIEW);
}, },
@ -553,7 +557,8 @@
.unbind("mousewheel." + this.getName()) .unbind("mousewheel." + this.getName())
.unbind("mouseenter." + this.getName()) .unbind("mouseenter." + this.getName())
.unbind("mousemove." + this.getName()) .unbind("mousemove." + this.getName())
.unbind("mouseleave." + this.getName()) .unbind("mouseleave." + this.getName());
BI.Widget._renderEngine.createElement(window)
.unbind("blur." + this.getName()); .unbind("blur." + this.getName());
BI.Resizers.remove(this.getName()); BI.Resizers.remove(this.getName());
this.popupView && this.popupView._destroy(); this.popupView && this.popupView._destroy();

Loading…
Cancel
Save