Changeset 390 for Dev/branches/rest-dojo-ui/client/rft/pages/question.js
- Timestamp:
- 08/06/12 18:41:53 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/branches/rest-dojo-ui/client/rft/pages/question.js
r389 r390 2 2 'dojo/_base/declare', 3 3 'dojo/_base/Deferred', 4 'dojo/_base/event', 4 5 'dojo/_base/lang', 5 'dojo/behavior',6 6 'rft/store', 7 7 'rft/content', … … 9 9 'rft/ui/QuestionEditorPreview', 10 10 'rft/ui/QuestionEditorToolkit' 11 ],function(declare, Deferred, lang, behavior, store, content, _Page, QuestionEditorPreview, QuestionEditorToolkit){11 ],function(declare, Deferred, event, lang, store, content, _Page, QuestionEditorPreview, QuestionEditorToolkit){ 12 12 return declare('rft.pages.question', [_Page], { 13 13 question: null, … … 26 26 } 27 27 this._setupEditor(); 28 this._setupButtons();29 28 }, 30 29 onLeave: function() { … … 35 34 this._preview.appendItems(this.question.content || []); 36 35 }, 37 _onSave: function( ) {36 _onSave: function(evt) { 38 37 lang.mixin(this.question, this._toolkit.get('value')); 39 38 this.question.content = this._preview.getItems(); … … 42 41 content.goTo('questions'); 43 42 }); 44 return true; 43 evt && event.stop( evt ); 44 return false; 45 45 }, 46 46 _onDiscard: function() { … … 48 48 return true; 49 49 }, 50 _setupButtons: function() {51 var behaviorMap = {52 "#btnSave": {53 onclick: lang.hitch(this, function(){54 this._onSave();55 })56 },57 "#btnDiscard": {58 onclick: lang.hitch(this, function(){59 this._onDiscard();60 })61 }62 }63 behavior.add(behaviorMap);64 behavior.apply();65 },66 50 _setupEditor: function() { 67 51 this._toolkit = new QuestionEditorToolkit({ 68 52 },this.QuestionEditorToolkitNode); 53 this._toolkit.on('submit',lang.hitch(this,"_onSave")); 69 54 this._toolkit.startup(); 70 55
Note: See TracChangeset
for help on using the changeset viewer.