Skip to content
This repository was archived by the owner on May 16, 2019. It is now read-only.

Commit 4ecab97

Browse files
committed
When userPageVw.js sets the handle in the address bar, also set it in the appBar.
- cleans up logic on address bar text - if the handle exists, sets the app bar title to the title
1 parent edb8efa commit 4ecab97

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

js/views/userPageVw.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -483,9 +483,10 @@ UserPageVw = pageVw.extend({
483483
},
484484

485485
setState: function(state, hash, options) {
486-
var currentAddress,
486+
var currentGUID = this.model.get('page').profile.guid,
487487
addressState,
488488
currentHandle = this.model.get('page').profile.handle,
489+
currentAddress,
489490
isItemType = false;
490491

491492
options = options || {};
@@ -552,16 +553,15 @@ UserPageVw = pageVw.extend({
552553
} else {
553554
addressState = "/" + state;
554555
}
555-
currentAddress = this.model.get('page').profile.guid + addressState;
556-
currentHandle = currentHandle ? currentHandle + addressState : "";
556+
557+
currentAddress = currentHandle || currentGUID;
558+
currentAddress += addressState;
557559
if (isItemType && hash) {
558-
currentAddress += "/"+ hash;
559-
currentHandle = currentHandle ? currentHandle += "/"+ hash : "";
560-
} else if (addressState === "createStore"){
561-
currentAddress = this.model.get('page').profile.guid;
560+
currentAddress += "/" + hash;
562561
}
563562

564-
window.obEventBus.trigger("setAddressBar", {'addressText': currentAddress, 'handle': currentHandle});
563+
window.obEventBus.trigger("setAddressBar", {'addressText': currentAddress});
564+
currentHandle && app.appBar.setTitle(currentHandle);
565565
},
566566

567567
setControls: function(state){

0 commit comments

Comments
 (0)