|
|
@ -12322,7 +12322,7 @@ BI.OB = function (config) { |
|
|
|
if (BI.isFunction(this.props)) { |
|
|
|
if (BI.isFunction(this.props)) { |
|
|
|
props = this.props(config); |
|
|
|
props = this.props(config); |
|
|
|
} |
|
|
|
} |
|
|
|
this.options = ($ || _).extend(this._defaultConfig(config), props, config); |
|
|
|
this.options = (window.$ || window._).extend(this._defaultConfig(config), props, config); |
|
|
|
this._init(); |
|
|
|
this._init(); |
|
|
|
this._initRef(); |
|
|
|
this._initRef(); |
|
|
|
}; |
|
|
|
}; |
|
|
@ -12343,7 +12343,7 @@ _.extend(BI.OB.prototype, { |
|
|
|
_initListeners: function () { |
|
|
|
_initListeners: function () { |
|
|
|
var self = this; |
|
|
|
var self = this; |
|
|
|
if (this.options.listeners != null) { |
|
|
|
if (this.options.listeners != null) { |
|
|
|
$.each(this.options.listeners, function (i, lis) { |
|
|
|
_.each(this.options.listeners, function (lis) { |
|
|
|
(lis.target ? lis.target : self)[lis.once ? "once" : "on"] |
|
|
|
(lis.target ? lis.target : self)[lis.once ? "once" : "on"] |
|
|
|
(lis.eventName, _.bind(lis.action, self)); |
|
|
|
(lis.eventName, _.bind(lis.action, self)); |
|
|
|
}); |
|
|
|
}); |
|
|
@ -12366,7 +12366,7 @@ _.extend(BI.OB.prototype, { |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
_getEvents: function () { |
|
|
|
_getEvents: function () { |
|
|
|
if (!$.isArray(this.events)) { |
|
|
|
if (!_.isArray(this.events)) { |
|
|
|
this.events = []; |
|
|
|
this.events = []; |
|
|
|
} |
|
|
|
} |
|
|
|
return this.events; |
|
|
|
return this.events; |
|
|
@ -12380,7 +12380,7 @@ _.extend(BI.OB.prototype, { |
|
|
|
on: function (eventName, fn) { |
|
|
|
on: function (eventName, fn) { |
|
|
|
eventName = eventName.toLowerCase(); |
|
|
|
eventName = eventName.toLowerCase(); |
|
|
|
var fns = this._getEvents()[eventName]; |
|
|
|
var fns = this._getEvents()[eventName]; |
|
|
|
if (!$.isArray(fns)) { |
|
|
|
if (!_.isArray(fns)) { |
|
|
|
fns = []; |
|
|
|
fns = []; |
|
|
|
this._getEvents()[eventName] = fns; |
|
|
|
this._getEvents()[eventName] = fns; |
|
|
|
} |
|
|
|
} |
|
|
@ -12412,9 +12412,9 @@ _.extend(BI.OB.prototype, { |
|
|
|
delete this._getEvents()[eventName]; |
|
|
|
delete this._getEvents()[eventName]; |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
var fns = this._getEvents()[eventName]; |
|
|
|
var fns = this._getEvents()[eventName]; |
|
|
|
if ($.isArray(fns)) { |
|
|
|
if (_.isArray(fns)) { |
|
|
|
var newFns = []; |
|
|
|
var newFns = []; |
|
|
|
$.each(fns, function (idx, ifn) { |
|
|
|
_.each(fns, function (ifn) { |
|
|
|
if (ifn != fn) { |
|
|
|
if (ifn != fn) { |
|
|
|
newFns.push(ifn); |
|
|
|
newFns.push(ifn); |
|
|
|
} |
|
|
|
} |
|
|
|