Opened 11 years ago

Closed 11 years ago

#12551 closed defect (fixed) moveTo does not work with hash

Reported by: bluk Owned by: ykami
Priority: high Milestone: 1.7
Component: DojoX Mobile Version: 1.6.0
Keywords: 1.7-mobile Cc:
Blocked By: Blocking:


In my application, I have a header like:

<h2 dojoType="" back="Home" moveTo="#home">Header</h2>

I require dojo.hash in my code. The latest trunk version of Dojo has an undefined error in function when I click on the back button.

                var view = this._view;
                var parent = dijit.byId(moveTo).getParent();
                    var myParent = view.getParent();
                    if (parent == myParent){
                    view = myParent;
                    view.performTransition(moveTo, -1, this.transition);

The problem is in the dijit.byId(moveTo) call. The moveTo could contain a hash like "#home" which dijit.byId() will not work with.

I temporarily changed the code to:

               var viewMoveTo = moveTo;
                if(moveTo !== undefined && typeof(moveTo) == "string" && moveTo.charAt(0) == '#'){
                    viewMoveTo = RegExp.$1;

                var view = this._view;
                var parent = dijit.byId(viewMoveTo).getParent();

I'm not sure if that's the right fix but it allowed me to make progress.

Change History (2)

comment:1 Changed 11 years ago by ykami

Keywords: 1.7-mobile added

You are correct, and your fix looks ok. I will slightly modify you fix simply because I don't want to duplicate the pattern matching code.

comment:2 Changed 11 years ago by ykami

Resolution: fixed
Status: newclosed

(In [24147]) Fixes #12551 !strict. Fixed a problem where dijit.byId("#someview") failed

Note: See TracTickets for help on using tickets.