File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -180,11 +180,10 @@ <h2>Mouse input</h2>
180
180
frame . disabled = true ;
181
181
document . body . removeClass ( 'preview' ) ;
182
182
headerTitle . textContent = initialTitle ;
183
- location . hash = '' ;
183
+ location . hash = '# ' ;
184
184
}
185
185
186
- // HISTORY
187
- window . addEventListener ( 'hashchange' , processLocation , false ) ;
186
+ var lastHash = null ;
188
187
189
188
function processLocation ( url ) {
190
189
if ( location . hash && location . hash !== '#' ) {
@@ -195,13 +194,21 @@ <h2>Mouse input</h2>
195
194
var title = element . querySelector ( 'h2' ) . textContent ;
196
195
var url = element . getAttribute ( 'data-link' ) ;
197
196
openExample ( title , url ) ;
197
+ lastHash = true ;
198
198
return ;
199
199
}
200
200
}
201
- closeExample ( ) ;
201
+
202
+ if ( lastHash ) {
203
+ closeExample ( ) ;
204
+ }
205
+ lastHash = true ;
202
206
}
203
207
204
208
processLocation ( ) ;
209
+
210
+ // HISTORY
211
+ window . addEventListener ( 'hashchange' , processLocation , false ) ;
205
212
</ script >
206
213
207
214
</ body >
You can’t perform that action at this time.
0 commit comments