Last change
on this file since 443 was
443,
checked in by hendrikvanantwerpen, 12 years ago
|
Reorganized for Node --- the SVN gods hate us all!
Lost all historical info on moved files, because SVN is a f *.
Also we have Node now, serving both the static content and forwarding
database requests.
|
File size:
883 bytes
|
Rev | Line | |
---|
[443] | 1 | define([ |
---|
| 2 | "../app/Page", |
---|
| 3 | "../store", |
---|
| 4 | "dojo/_base/array", |
---|
| 5 | "dojo/_base/declare", |
---|
| 6 | "dojo/_base/lang", |
---|
| 7 | "dojo/when", |
---|
| 8 | "require", |
---|
| 9 | "dojo/text!./templates/previewSurvey.html" |
---|
| 10 | ], function(Page, store, array, declare, lang, when, require, template) { |
---|
| 11 | return declare([Page],{ |
---|
| 12 | contextRequire: require, |
---|
| 13 | templateString: template, |
---|
| 14 | startup: function() { |
---|
| 15 | if ( this._started ) { return; } |
---|
| 16 | this.inherited(arguments); |
---|
| 17 | if ( this.surveyId ) { |
---|
| 18 | when(store.get(this.surveyId)) |
---|
| 19 | .then(lang.hitch(this,function(survey){ |
---|
| 20 | this.titleNode.innerHTML = survey.title; |
---|
| 21 | this.surveyWidget.set('survey',survey); |
---|
| 22 | })); |
---|
| 23 | } else { |
---|
| 24 | throw new Error("No valid uid or survey passed!"); |
---|
| 25 | } |
---|
| 26 | } |
---|
| 27 | }); |
---|
| 28 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.