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

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

Small fixes fir urls and validation.

File size: 930 bytes
RevLine 
[443]1define([
[490]2    "../classes/surveys",
[457]3    "dijit/_TemplatedMixin",
4    "dijit/_WidgetBase",
5    "dojo/_base/declare",
6    "dojo/dom-attr",
7    "dojo/text!./templates/SurveySummary.html"
[490]8], function(surveys, _TemplatedMixin, _WidgetBase, declare, domAttr, template) {
[443]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) {
[487]19            this.titleNode.innerHTML = survey.title || "";
[512]20            domAttr.set(this.titleNode, "href",
21                        survey && ('#!'+surveys.getObjectPath(survey)));
[493]22            this.descriptionNode.innerHTML = survey.description || "";
[487]23            this.questionsNode.innerHTML = survey.questions.length;
[443]24        }
25    });
[457]26});
Note: See TracBrowser for help on using the repository browser.