File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 275275 self . click ( $ ( this ) . attr ( "href" ) , e ) ;
276276 } ) ;
277277
278+ // Use only the part of location.hash that is in front of the first
279+ // slash. This is for frameworks like Backbone.js where you might have
280+ // a URL like http://example.com/myapp#users/pg/3
281+ var slashIndex = location . hash . indexOf ( "/" ) ,
282+ locationHashStr = slashIndex === - 1 ? location . hash : location . hash . slice ( 0 , slashIndex ) ;
283+
278284 // open initial tab
279- if ( location . hash && conf . tabs == "a" && root . find ( "[href=" + location . hash + "]" ) . length ) {
280- self . click ( location . hash ) ;
285+ if ( locationHashStr && conf . tabs == "a" && root . find ( "[href=" + locationHashStr + "]" ) . length ) {
286+ self . click ( locationHashStr ) ;
281287
282288 } else {
283289 if ( conf . initialIndex === 0 || conf . initialIndex > 0 ) {
284290 self . click ( conf . initialIndex ) ;
285291 }
286- }
292+ }
287293
288294 }
289295
You can’t perform that action at this time.
0 commit comments