[FIX] web: abstract_view: don't override shared config variable

The method 'setController' allows to change the default Controller
Widget used by the view. However, before this fix, calling it
changed the default Controller of all other Controller instances.
This commit is contained in:
Aaron Bohy
2017-04-11 19:44:38 +02:00
parent 386820abbe
commit b997309cf6
@@ -119,7 +119,7 @@ var AbstractView = Class.extend({
return $.when(model.load(this.loadParams), this._loadLibs()).then(function () {
var state = model.get(arguments[0]);
var renderer = self.createRenderer(parent, state);
var Controller = self.config.Controller;
var Controller = self.Controller || self.config.Controller;
var controllerParams = _.extend({
initialState: state,
}, self.controllerParams);
@@ -149,7 +149,7 @@ var AbstractView = Class.extend({
* @param {Controller} Controller
*/
setController: function (Controller) {
this.config.Controller = Controller;
this.Controller = Controller;
},
//--------------------------------------------------------------------------