in xf/src/xf.model.js [31:64]
constructor: function(attributes, options) {
this._initProperties();
this._bindListeners();
if (!options) {
options = {};
}
if (options.component) {
this.component = options.component;
}
_.omit(options, 'component');
this.urlRoot = this.urlRoot || XF.settings.property('dataUrlPrefix').replace(/(\/$)/g, '') + '/' + (_.has(this, 'component') && this.component !== null && _.has(this.component, 'name') ? this.component.name + '/' : '');
if (_.has(this, 'component') && this.component !== null && this.component.options.updateOnShow) {
Dom(this.component.selector()).bind('show', _.bind(this.refresh, this));
}
this.ajaxSettings = this.ajaxSettings || XF.settings.property('ajaxSettings');
if (_.has(this.ajaxSettings, 'success') && _.isFunction(this.ajaxSettings.success)) {
var onSuccess = this.ajaxSettings.success,
onDataLoaded = _.bind(this._onDataLoaded, this);
this.ajaxSettings.success = function() {
onDataLoaded();
onSuccess();
};
} else {
this.ajaxSettings.success = _.bind(this._onDataLoaded, this);
}
BB.Model.apply(this, arguments);
},