- Timestamp:
- 03/13/14 01:19:07 (11 years ago)
- Location:
- Dev/trunk/src/client/qed-client
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
Dev/trunk/src/client/qed-client/model/widgets/QuestionEditorPreviewItem.js
r511 r512 149 149 if ( this.innerWidget !== null ) { 150 150 if ( this._editing === true ) { 151 this. _onChange();151 this.triggerOnChange(); 152 152 } 153 153 this.removeChild(this.innerWidget); -
Dev/trunk/src/client/qed-client/model/widgets/SurveyRunWidget.js
r506 r512 8 8 templateString: template, 9 9 postCreate: function() { 10 this.inherited(arguments); 10 11 var endDateBox = this.endDateBox; 11 12 this.own(this.startDateBox.on('change', function(value){ 12 13 endDateBox.constraints.min = value; 13 14 })); 15 }, 16 startup: function() { 17 this.inherited(arguments); 14 18 }, 15 19 _getValueAttr: function() { -
Dev/trunk/src/client/qed-client/model/widgets/SurveySummary.js
r493 r512 18 18 _setValueAttr: function(survey) { 19 19 this.titleNode.innerHTML = survey.title || ""; 20 domAttr.set(this.titleNode, "href", survey && surveys.getObjectPath(survey)); 20 domAttr.set(this.titleNode, "href", 21 survey && ('#!'+surveys.getObjectPath(survey))); 21 22 this.descriptionNode.innerHTML = survey.description || ""; 22 23 this.questionsNode.innerHTML = survey.questions.length; -
Dev/trunk/src/client/qed-client/model/widgets/templates/SurveyWidget.html
r492 r512 1 1 <form class="${baseClass}"> 2 2 <label for="title">Title</label> 3 <input data-dojo-type="dijit/form/TextBox" name="title"/><br/> 3 <input data-dojo-type="dijit/form/ValidationTextBox" 4 data-dojo-props="required: true" 5 name="title"/><br/> 4 6 <label for="description">Description</label> 5 7 <textarea data-dojo-type="dijit/form/Textarea" name="description"></textarea><br/> -
Dev/trunk/src/client/qed-client/pages/survey.js
r503 r512 5 5 "../model/widgets/TabbedQuestionBrowser", 6 6 "./_ObjectPage", 7 "dojo/Deferred", 7 8 "dojo/_base/array", 8 9 "dojo/_base/declare", … … 12 13 "require", 13 14 "dojo/text!./templates/survey.html" 14 ], function(Router, surveys, QuestionListView, TabbedQuestionBrowser, _ObjectPage, array, declare, event, lang, when, require, template) {15 ], function(Router, surveys, QuestionListView, TabbedQuestionBrowser, _ObjectPage, Deferred, array, declare, event, lang, when, require, template) { 15 16 return declare([_ObjectPage],{ 16 17 contextRequire: require, … … 77 78 }, 78 79 _handleQuestionsChange: function() { 79 this. object.questions = this.questionList.get('value');80 this._updateObject(); 80 81 this.markDirty(); 81 82 this._refresh(); 82 83 }, 83 84 _handlePropertiesChange: function() { 84 lang.mixin(this.object, this.propertiesForm.get('value').survey);85 this._updateObject(); 85 86 this.markDirty(); 86 87 this._refresh(); 87 88 this.layout(); 89 }, 90 _updateObject: function() { 91 this._isValid = this.propertiesForm.validate(); 92 lang.mixin(this.object, this.propertiesForm.get('value').survey); 93 this.object.questions = this.questionList.get('value'); 94 return this._isValid; 88 95 }, 89 96 _onSave: function(evt) { … … 109 116 }); 110 117 }, 118 _save: function() { 119 if ( this._updateObject ) { 120 return this.inherited(arguments); 121 } else { 122 return new Deferred().reject({error:"Please correct invalid values."}); 123 } 124 }, 111 125 markDirty: function() { 112 this.saveBtn.set('disabled', false);113 this.saveAndCloseBtn.set('disabled', false);126 this.saveBtn.set('disabled',!this._isValid); 127 this.saveAndCloseBtn.set('disabled',!this._isValid); 114 128 this.discardBtn.set('label','Discard & Close'); 115 129 this.inherited(arguments); -
Dev/trunk/src/client/qed-client/widgets/_ComplexValueMixin.js
r511 r512 46 46 }); 47 47 }, 48 // Yuk, this function is taken directly from _FromMixin only49 // to add the priorityChange parameter50 48 _getValueAttr: function() { 51 49 this.value = this.inherited(arguments); 52 50 return this.value; 53 51 }, 52 // Yuk, _setValueAttr is taken directly from _FromMixin only 53 // to add the priorityChange parameter 54 54 _setValueAttr: function(obj, priorityChange) { 55 55 this.value = obj; … … 99 99 _handleChange: function(evt) { 100 100 if ( evt.target !== this.domNode ) { 101 this. _onChange();101 this.triggerOnChange(); 102 102 if ( evt ) { event.stop(evt); } 103 103 return false; … … 120 120 return false; 121 121 }, 122 _onChange: function() {122 triggerOnChange: function() { 123 123 if ( this._onChangeActive && 124 124 !(this.readOnly || this.disabled) ) {
Note: See TracChangeset
for help on using the changeset viewer.