Skip to content

Commit d39b492

Browse files
author
Philip Guo
committed
more subtleties
1 parent 00f4ed2 commit d39b492

1 file changed

Lines changed: 3 additions & 10 deletions

File tree

‎v3/js/opt-frontend.js‎

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ $(document).ready(function() {
8484
$(window).bind("hashchange", function(e) {
8585
appMode = $.bbq.getState('mode'); // assign this to the GLOBAL appMode
8686

87-
console.log('hashchange:', appMode);
87+
//console.log('hashchange:', appMode);
8888

8989
preseededCode = $.bbq.getState('code'); // yuck, global!
9090
var preseededMode = $.bbq.getState('mode');
@@ -113,16 +113,9 @@ $(document).ready(function() {
113113
}
114114

115115
// if there's no myVisualizer, then default to edit mode since there's
116-
// nothing to visualize:
116+
// nothing to visualize yet:
117117
if (!myVisualizer) {
118118
appMode = 'edit';
119-
120-
if (preseededCode && preseededMode == 'display') {
121-
// punt for now ...
122-
}
123-
else {
124-
$.bbq.pushState({ mode: 'edit' }, 2 /* completely override other hash strings to keep URL clean */);
125-
}
126119
}
127120

128121

@@ -257,7 +250,7 @@ $(document).ready(function() {
257250
// also scroll to top to make the UI more usable on smaller monitors
258251
$(document).scrollTop(0);
259252

260-
$.bbq.pushState({ mode: 'display' });
253+
$.bbq.pushState({ mode: 'display' }, 2 /* completely override other hash strings to keep URL clean */);
261254
}
262255
},
263256
"json");

0 commit comments

Comments
 (0)