Changeset 487 for Dev/trunk/src/client/qed-client/pages/question.js
- Timestamp:
- 03/05/14 22:44:48 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/pages/question.js
r443 r487 3 3 "../app/Page", 4 4 "../app/Router", 5 "../model/classes/ Question",5 "../model/classes/questions", 6 6 "../model/widgets/QuestionEditorPreview", 7 7 "../model/widgets/QuestionEditorToolkit", 8 "../store",9 8 "../widgets/_ComplexValueMixin", 10 9 "dojo/_base/declare", … … 13 12 "dojo/when", 14 13 "dojo/text!./templates/question.html" 15 ], function(Content, Page, Router, Question, QuestionEditorPreview, QuestionEditorToolkit, store, _ComplexValueMixin, declare, event, lang, when, template) {14 ], function(Content, Page, Router, questions, QuestionEditorPreview, QuestionEditorToolkit, _ComplexValueMixin, declare, event, lang, when, template) { 16 15 return declare([Page,_ComplexValueMixin], { 17 16 templateString: template, … … 43 42 } 44 43 if (this.questionId === "new") { 45 this.set('value', Question.create());44 this.set('value', questions.create()); 46 45 } else { 47 when( store.get(this.questionId))46 when(questions.load(this.questionId)) 48 47 .then(lang.hitch(this, function(value) { 49 48 this.set('value', value); … … 54 53 this.value = value; 55 54 this.inherited(arguments); 56 this.titleNode.innerHTML = Question.DisplayTitle.get(value);55 this.titleNode.innerHTML = value.title || ""; 57 56 }, 58 57 _getValueAttr: function() { … … 63 62 _onSave: function(evt) { 64 63 if ( this.validate() ) { 65 var value = this.get('value'); 66 store.put(value) 64 questions.save(this.get('value')) 67 65 .then(function() { 68 66 Router.go('/questions');
Note: See TracChangeset
for help on using the changeset viewer.