source: Dev/trunk/src/client/qed-client/model/widgets/SurveySummary.js @ 535

Last change on this file since 535 was 512, checked in by hendrikvanantwerpen, 11 years ago

Small fixes fir urls and validation.

File size: 930 bytes
Line 
1define([
2    "../classes/surveys",
3    "dijit/_TemplatedMixin",
4    "dijit/_WidgetBase",
5    "dojo/_base/declare",
6    "dojo/dom-attr",
7    "dojo/text!./templates/SurveySummary.html"
8], function(surveys, _TemplatedMixin, _WidgetBase, declare, domAttr, template) {
9    return declare([_WidgetBase,_TemplatedMixin],{
10        templateString: template,
11        survey: null,
12        startup: function() {
13            this.inherited(arguments);
14            if ( this.survey ) {
15                this._setValueAttr(this.survey);
16            }
17        },
18        _setValueAttr: function(survey) {
19            this.titleNode.innerHTML = survey.title || "";
20            domAttr.set(this.titleNode, "href",
21                        survey && ('#!'+surveys.getObjectPath(survey)));
22            this.descriptionNode.innerHTML = survey.description || "";
23            this.questionsNode.innerHTML = survey.questions.length;
24        }
25    });
26});
Note: See TracBrowser for help on using the repository browser.