-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Milestone
Description
define Application region in runtime
as i can see, there is no chance to do it right now, because user can pass to region property region class
if this improvement will be accepted: #3569 , then i can offer this kind of improvement for resolving this issue
Application
constructor: function constructor(options) {
this._setOptions(options);
this.mergeOptions(options, ClassOptions$7);
//this._initRegion(); //remove this line;
MarionetteObject.prototype.constructor.apply(this, arguments);
},
_initRegion: function _initRegion() {
var region = this.getOption('region', true); // old line: var region = this.region;
if (!region) {
return;
}
var defaults = {
regionClass: this.regionClass
};
this._region = buildRegion(region, defaults);
},
getRegion: function getRegion() {
if(!this._region) this._initRegion();
return this._region;
},
this will help define application as a function, and allow to initialize a region only if a region will be accessed, even after start of application
Reactions are currently unavailable