Browse Source

Pull request #2465: 无JIRA任务 listeners支持object格式

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

* commit '18de5ac802abd4aca687ba90221dc81a0a87cc98':
  update
  update
  listeners支持object格式
es6
guy 3 years ago
parent
commit
7b5bde1210
  1. 2
      src/case/combo/bubblecombo/popup.bubble.js
  2. 9
      src/core/3.ob.js

2
src/case/combo/bubblecombo/popup.bubble.js

@ -31,7 +31,7 @@ BI.BubblePopupBarView = BI.inherit(BI.BubblePopupView, {
buttons: [{
value: false,
text: BI.i18nText("BI-Basic_Cancel"),
ghost: true
level: "ignore"
}, {
text: BI.i18nText(BI.i18nText("BI-Basic_OK")),
value: true

9
src/core/3.ob.js

@ -62,9 +62,12 @@
_initListeners: function () {
var self = this;
if (this.options.listeners != null) {
_.each(this.options.listeners, function (lis) {
(lis.target ? lis.target : self)[lis.once ? "once" : "on"]
(lis.eventName, _.bind(lis.action, self));
_.each(this.options.listeners, function (lis, eventName) {
if (_.isFunction(lis)) {
self.on(eventName, lis);
return;
}
(lis.target ? lis.target : self)[lis.once ? "once" : "on"](lis.eventName, lis.action);
});
delete this.options.listeners;
}

Loading…
Cancel
Save