Ignore:
Timestamp:
03/11/14 00:41:43 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • ListWidget? can be disabled/readOnyl now.
  • Disable question and survey pages when published.
  • Removed weird dialog from survey page and just put a form there. Not very nice, but more consistent with the rest I would say.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/pages/survey.js

    r500 r502  
    2424            this._setupListView();
    2525            this.own(this.questionList.on('change',lang.hitch(this,'_handleQuestionsChange')));
     26            this.own(this.propertiesForm.on('change',lang.hitch(this,'_handlePropertiesChange')));
    2627            this._load();
    2728        },
     
    6768            }
    6869            this.titleNode.innerHTML = this.object.title || "(set title in properties)";
     70            if ( this.object.publicationDate ) {
     71                this.propertiesForm.set('readOnly',true);
     72                this.propertiesForm.set('disabled',true);
     73                this.questionList.set('readOnly',true);
     74                this.questionList.set('disabled',true);
     75            }
    6976        },
    7077        _includeQuestion: function(question) {
     
    7683            this._refresh();
    7784        },
    78         _onShowProperties: function(evt) {
    79             this.propertiesDialog.show();
    80             if ( evt ) { event.stop(evt); }
    81             return false;
    82         },
    83         _onPropertiesOk: function(evt) {
    84             this.propertiesDialog.hide();
     85        _handlePropertiesChange: function() {
    8586            lang.mixin(this.object, this.propertiesForm.get('value').survey);
    8687            this.markDirty();
    8788            this._refresh();
    88             if ( evt ) { event.stop(evt); }
    89             return false;
    90         },
    91         _onPropertiesCancel: function(evt) {
    92             this.propertiesDialog.hide();
    93             this.propertiesForm.set('value',{survey:this.object});
    94             if ( evt ) { event.stop(evt); }
    95             return false;
     89            this.layout();
    9690        },
    9791        _onSave: function(evt) {
     
    128122            this.discardBtn.set('label','Close');
    129123            this.inherited(arguments);
     124        },
     125        _ignore: function(evt) {
     126            event.stop(evt);
     127            return false;
    130128        }
    131129    });
Note: See TracChangeset for help on using the changeset viewer.