Changeset 491


Ignore:
Timestamp:
03/08/14 23:48:08 (11 years ago)
Author:
hendrikvanantwerpen
Message:
  • Include _ObjectPage this time.
  • Hash replace doesn't reload page.
  • Widget in dialog has name to actually give results.
Location:
Dev/trunk/src/client/qed-client
Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • Dev/trunk/src/client/qed-client/app/Page.js

    r490 r491  
    11define([
    22    "./Content",
    3     "./Path",
     3    "./Router",
    44    "dijit/_TemplatedMixin",
    55    "dijit/_WidgetsInTemplateMixin",
    66    "dijit/layout/BorderContainer",
    77    "dojo/_base/declare",
    8     "dojo/_base/lang",
    9     "dojo/hash"
    10 ], function(Content, Path, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, declare, lang, hash) {
     8    "dojo/_base/lang"
     9], function(Content, Router, _TemplatedMixin, _WidgetsInTemplateMixin, BorderContainer, declare, lang) {
    1110    var Page = declare([BorderContainer,_TemplatedMixin,_WidgetsInTemplateMixin],{
    1211        templateString: '<div>Empty page.</div>',
     
    1413            Content.set(new Page({templateString:'<div>Error: '+msg+'</div>'}));
    1514        },
     15        go: lang.hitch(Router,'go'),
    1616        notify: lang.hitch(Content,'notify'),
    17         setURL: function(url,opts,addToHistory) {
    18             hash(Path.format(url,opts),addToHistory !== true);
    19         },
    2017        markDirty: lang.hitch(Content,'markDirty'),
    2118        markClean: lang.hitch(Content,'markClean')
  • Dev/trunk/src/client/qed-client/app/Router.js

    r490 r491  
    11define([
    22    "./Content",
    3     "./Page",
    43    "./Path",
    54    "dojo/_base/declare",
     
    98    "dojo/hash",
    109    "dojo/on",
    11     "dojo/topic"
    12 ], function(Content, Page, Path, declare, event, lang, window, hash, on, topic) {
     10    "dojo/topic",
     11    "require"
     12], function(Content, Path, declare, event, lang, window, hash, on, topic, require) {
    1313
    1414    var Router = declare(null,{
     
    108108            return true;
    109109        },
    110         go: function(path,args) {
     110        go: function(path,args,replace) {
    111111            if ( !this._started ) { return; }
    112112            var newHash = Path.format(path,args);
    113             hash(newHash);
     113            if ( replace === true ) {
     114                this._beforePreviousHash = this._previousHash;
     115                this._previousHash = newHash;
     116            }
     117            hash(newHash,replace);
    114118        },
    115119        _defaultCallback: function() {
    116             Content.set(new Page({
    117                 templateString: "<div>Requested page not found. Go <a href=\"#"+Path.getDefault()+"\">home</a>.</div>"
    118             }));
     120            require("./Page",function(Page){
     121                Content.set(new Page({
     122                    templateString: "<div>Requested page not found. Go <a href=\"#"+Path.getDefault()+"\">home</a>.</div>"
     123                }));
     124            });
    119125        }
    120126    });
  • Dev/trunk/src/client/qed-client/pages/survey.js

    r490 r491  
    5858        _refresh: function() {
    5959            this.titleNode.innerHTML = this.object.title || "(set title in properties)";
    60             this.propertiesDialog.set('value',this.object);
     60            this.propertiesDialog.set('value',{survey:this.object});
    6161            this.questionList.set('value',
    6262                                  this.object.questions);
     
    7676        _onPropertiesOk: function(evt) {
    7777            this.propertiesDialog.hide();
    78             lang.mixin(this.object, this.propertiesDialog.get('value'));
     78            lang.mixin(this.object, this.propertiesDialog.get('value').survey);
    7979            this.markDirty();
    8080            this._refresh();
     
    8484        _onPropertiesCancel: function(evt) {
    8585            this.propertiesDialog.hide();
    86             this.propertiesDialog.set('value',this.object);
     86            this.propertiesDialog.set('value',{survey:this.object});
    8787            if ( evt ) { event.stop(evt); }
    8888            return false;
  • Dev/trunk/src/client/qed-client/pages/templates/survey.html

    r490 r491  
    4545         data-dojo-attach-event="onSubmit:_onPropertiesOk">
    4646        <fieldset class="qedFieldset">
    47             <div data-dojo-type="../model/widgets/SurveyWidget"></div>
     47            <div data-dojo-type="../model/widgets/SurveyWidget" data-dojo-props="name:'survey'"></div>
    4848        </fieldset>
    4949        <button data-dojo-type="dijit/form/Button"
Note: See TracChangeset for help on using the changeset viewer.