Last change
on this file since 461 was
457,
checked in by hendrikvanantwerpen, 12 years ago
|
Improve SurveyRun? form and drop Fieldsets as widgets.
- Improved console message on Page change fail.
- Renamed some widgets, dropped having Fieldset widgets.
- Put constraint that survey run start date cannot be before end date.
- Link to survey from survey summary,
|
File size:
970 bytes
|
Line | |
---|
1 | define([ |
---|
2 | "../../store", |
---|
3 | "../classes/Survey", |
---|
4 | "dijit/_TemplatedMixin", |
---|
5 | "dijit/_WidgetBase", |
---|
6 | "dojo/_base/declare", |
---|
7 | "dojo/dom-attr", |
---|
8 | "dojo/text!./templates/SurveySummary.html" |
---|
9 | ], function(store, Survey, _TemplatedMixin, _WidgetBase, declare, domAttr, template) { |
---|
10 | return declare([_WidgetBase,_TemplatedMixin],{ |
---|
11 | templateString: template, |
---|
12 | survey: null, |
---|
13 | startup: function() { |
---|
14 | this.inherited(arguments); |
---|
15 | if ( this.survey ) { |
---|
16 | this._setValueAttr(this.survey); |
---|
17 | } |
---|
18 | }, |
---|
19 | _setValueAttr: function(survey) { |
---|
20 | this.titleNode.innerHTML = Survey.DisplayTitle.get(survey); |
---|
21 | var id = store.getIdentity(survey); |
---|
22 | domAttr.set(this.titleNode, "href", id && ("#!/survey/"+id)); |
---|
23 | this.descriptionNode.innerHTML = survey.description; |
---|
24 | this.questionsNode.innerHTML = (survey.questions || []).length; |
---|
25 | } |
---|
26 | }); |
---|
27 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.