Changeset 415 for Dev/branches/rest-dojo-ui/client/rft/pages/question.js
- Timestamp:
- 12/04/12 16:29:49 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/pages/question.js
r410 r415 21 21 if ( this._started ) { return; } 22 22 this.inherited(arguments); 23 if (this.questionId) { 23 if ( !this.questionId ) { 24 throw new Error("Error: no reference to object set!"); 25 } 26 this._setupEditor(); 27 if (this.questionId === "new") { 28 this.question = { type: 'Question' }; 29 this._refresh(); 30 } else { 24 31 Deferred.when(store.get(this.questionId)) 25 32 .then(lang.hitch(this, function(obj) { … … 27 34 this._refresh(); 28 35 })); 29 } else {30 throw new Error("Error: no reference to object set!");31 36 } 32 this._setupEditor();33 37 }, 34 38 onLeave: function() { … … 36 40 }, 37 41 _refresh: function () { 42 this.titleNode.innerHTML = this.question.title || ""; 38 43 this._toolkit.set('value',this.question); 39 44 this._preview.appendItems(this.question.content || []); … … 46 51 Router.go('/questions'); 47 52 },function(err){ 48 Content.notify(err .reason,'error');53 Content.notify(err,'error'); 49 54 }); 50 55 evt && event.stop( evt );
Note: See TracChangeset
for help on using the changeset viewer.