[API] Update todo tutorial

...to expect new domain object API (instead of explicitly
wrapping it.)
This commit is contained in:
Victor Woeltjen 2016-08-11 15:29:46 -07:00
parent 1147f3aa47
commit 8295a0bed1

View File

@ -48,7 +48,6 @@ define([
var self = this;
this.destroy();
mct.Objects.get(utils.parseKeyString(self.domainObject.getId())).then(function (object) {
self.$els = $(todoTemplate);
self.$buttons = {
all: self.$els.find('.example-todo-button-all'),
@ -60,10 +59,9 @@ define([
self.initialize();
self.objectChanged(object);
self.objectChanged(this.domainObject);
mct.selection.on('change', self.render);
});
};
TodoView.prototype.destroy = function () {
@ -148,9 +146,7 @@ define([
var self = this;
this.destroy();
mct.Objects.get(utils.parseKeyString(this.domainObject.getId())).then(function (wrappedObject){
self.mutableObject = mct.Objects.getMutable(wrappedObject);
self.mutableObject = mct.Objects.getMutable(this.domainObject);
var $els = $(toolbarTemplate);
var $add = $els.find('a.example-add');
@ -188,7 +184,6 @@ define([
self.$remove = $remove;
self.handleSelectionChange();
mct.selection.on('change', self.handleSelectionChange);
});
};
TodoToolbarView.prototype.handleSelectionChange = function () {