source: Dev/trunk/src/client/qed-client/model/widgets/SurveyRunWidget.js @ 495

Last change on this file since 495 was 494, checked in by hendrikvanantwerpen, 11 years ago
  • Removed all Coffeescript from codebase (build process is still there).
  • Nicer message on failed login.
  • Own all event subscriptions from widgets.
  • Update objects in _ObjectPage with invalid info too, or our refresh will overwrite what user did.
File size: 1.1 KB
Line 
1define([
2    "../../widgets/_ComplexValueWidget",
3    "dojo/_base/declare",
4    "dojo/date",
5    "dojo/text!./templates/SurveyRunWidget.html"
6], function(_ComplexValueWidget, declare, date, template) {
7    return declare([_ComplexValueWidget],{
8        templateString: template,
9        postCreate: function() {
10            var endDateBox = this.endDateBox;
11            this.own(this.startDateBox.on('change', function(value){
12                endDateBox.constraints.min  = value;
13            }));
14        },
15        _getValueAttr: function() {
16            var value = this.inherited(arguments);
17            if ( !value.startDate ) { delete value.startDate; }
18            if ( !value.endDate ) { delete value.endDate; }
19            value.respondentCanDeleteOwnResponse =
20                value.respondentCanDeleteOwnResponse.length > 0;
21            return value;
22        },
23        _setValueAttr: function(value) {
24            value.respondentCanDeleteOwnResponse =
25                value.respondentCanDeleteOwnResponse ? ["on"] : [];
26            this.inherited(arguments);
27        }
28    });
29});
Note: See TracBrowser for help on using the repository browser.