Changeset 491 for Dev/trunk/src/client/qed-client/app/Router.js
- Timestamp:
- 03/08/14 23:48:08 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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 });
Note: See TracChangeset
for help on using the changeset viewer.