X-Git-Url: http://git.bytex64.net/?a=blobdiff_plain;f=www%2Fjssrc%2Fblerg%2FMain.js;h=686b86c25cdf5f1d1fc2c1b396d0068d65185430;hb=80ad774f55998cc11e08694245dfd6cb1b49a86f;hp=4c1fa27a02b96951513144e03e22e6fa9ab98e7e;hpb=8f3918fbe3d812782d70af32b0d122bcd16a4c65;p=blerg.git diff --git a/www/jssrc/blerg/Main.js b/www/jssrc/blerg/Main.js index 4c1fa27..686b86c 100644 --- a/www/jssrc/blerg/Main.js +++ b/www/jssrc/blerg/Main.js @@ -1,16 +1,24 @@ enyo.kind({ - name: "blerg.Main", - kind: "Control", - classes: "blerg-main", - currentView: null, - updateView: function(objdef) { - if (!this.currentView || objdef.kind != this.currentView.kind) { - this.destroyComponents(); - this.currentView = this.createComponent(objdef); - this.currentView.render(); - } else { - for (var i in objdef) - this.currentView.setProperty(i, objdef[i]) - } - } + name: "blerg.Main", + kind: "Control", + classes: "blerg-main", + currentView: null, + updateView: function(objdef) { + if (!this.currentView || objdef.kind != this.currentView.kind) { + this.destroyComponents(); + this.currentView = this.createComponent(objdef); + this.currentView.render(); + } else { + // We don't want to invoke any change handlers until + // these are all set, so we do that ourselves + for (var i in objdef) { + if (i == 'kind') continue; + this.currentView[i] = objdef[i]; + } + for (var i in objdef) { + if (i == 'kind') continue; + this.currentView[i + 'Changed'] && this.currentView[i + 'Changed'](); + } + } + } });