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.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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    });
Note: See TracChangeset for help on using the changeset viewer.