Changeset 491
- Timestamp:
- 03/08/14 23:48:08 (11 years ago)
- 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 1 1 define([ 2 2 "./Content", 3 "./ Path",3 "./Router", 4 4 "dijit/_TemplatedMixin", 5 5 "dijit/_WidgetsInTemplateMixin", 6 6 "dijit/layout/BorderContainer", 7 7 "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) { 11 10 var Page = declare([BorderContainer,_TemplatedMixin,_WidgetsInTemplateMixin],{ 12 11 templateString: '<div>Empty page.</div>', … … 14 13 Content.set(new Page({templateString:'<div>Error: '+msg+'</div>'})); 15 14 }, 15 go: lang.hitch(Router,'go'), 16 16 notify: lang.hitch(Content,'notify'), 17 setURL: function(url,opts,addToHistory) {18 hash(Path.format(url,opts),addToHistory !== true);19 },20 17 markDirty: lang.hitch(Content,'markDirty'), 21 18 markClean: lang.hitch(Content,'markClean') -
Dev/trunk/src/client/qed-client/app/Router.js
r490 r491 1 1 define([ 2 2 "./Content", 3 "./Page",4 3 "./Path", 5 4 "dojo/_base/declare", … … 9 8 "dojo/hash", 10 9 "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) { 13 13 14 14 var Router = declare(null,{ … … 108 108 return true; 109 109 }, 110 go: function(path,args ) {110 go: function(path,args,replace) { 111 111 if ( !this._started ) { return; } 112 112 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); 114 118 }, 115 119 _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 }); 119 125 } 120 126 }); -
Dev/trunk/src/client/qed-client/pages/survey.js
r490 r491 58 58 _refresh: function() { 59 59 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}); 61 61 this.questionList.set('value', 62 62 this.object.questions); … … 76 76 _onPropertiesOk: function(evt) { 77 77 this.propertiesDialog.hide(); 78 lang.mixin(this.object, this.propertiesDialog.get('value') );78 lang.mixin(this.object, this.propertiesDialog.get('value').survey); 79 79 this.markDirty(); 80 80 this._refresh(); … … 84 84 _onPropertiesCancel: function(evt) { 85 85 this.propertiesDialog.hide(); 86 this.propertiesDialog.set('value', this.object);86 this.propertiesDialog.set('value',{survey:this.object}); 87 87 if ( evt ) { event.stop(evt); } 88 88 return false; -
Dev/trunk/src/client/qed-client/pages/templates/survey.html
r490 r491 45 45 data-dojo-attach-event="onSubmit:_onPropertiesOk"> 46 46 <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> 48 48 </fieldset> 49 49 <button data-dojo-type="dijit/form/Button"
Note: See TracChangeset
for help on using the changeset viewer.