@@ -383,18 +383,28 @@ define([
383
383
breadcrumb . empty ( ) ;
384
384
var list_item = $ ( '<li/>' ) ;
385
385
var root_url = utils . url_path_join ( that . base_url , '/tree' ) ;
386
- var root = $ ( '<li/>' ) . append ( '<a href="' + root_url + '"><i class="fa fa-folder"></i></a>' ) . click ( function ( e ) {
387
- // Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
388
- if ( e . altKey || e . metaKey || e . shiftKey ) {
389
- return true ;
390
- }
391
- var path = '' ;
392
- window . history . pushState ( {
393
- path : path
394
- } , 'Home' , utils . url_path_join ( that . base_url , 'tree' ) ) ;
395
- that . update_location ( path ) ;
396
- return false ;
397
- } ) ;
386
+ var root = $ ( '<li/>' ) . append (
387
+ $ ( "<a/>" )
388
+ . attr ( 'href' , root_url )
389
+ . append (
390
+ $ ( "<i/>" )
391
+ . addClass ( 'fa fa-folder' )
392
+ )
393
+ . click ( function ( e ) {
394
+ // Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
395
+ if ( e . altKey || e . metaKey || e . shiftKey ) {
396
+ return true ;
397
+ }
398
+ var path = '' ;
399
+ window . history . pushState (
400
+ { path : path } ,
401
+ 'Home' ,
402
+ utils . url_path_join ( that . base_url , 'tree' )
403
+ ) ;
404
+ that . update_location ( path ) ;
405
+ return false ;
406
+ } )
407
+ ) ;
398
408
breadcrumb . append ( root ) ;
399
409
var path_parts = [ ] ;
400
410
this . notebook_path . split ( '/' ) . forEach ( function ( path_part ) {
@@ -405,17 +415,24 @@ define([
405
415
'/tree' ,
406
416
utils . encode_uri_components ( path )
407
417
) ;
408
- var crumb = $ ( '<li/>' ) . append ( '<a href="' + url + '">' + path_part + '</a>' ) . click ( function ( e ) {
409
- // Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
410
- if ( e . altKey || e . metaKey || e . shiftKey ) {
411
- return true ;
412
- }
413
- window . history . pushState ( {
414
- path : path
415
- } , path , url ) ;
416
- that . update_location ( path ) ;
417
- return false ;
418
- } ) ;
418
+ var crumb = $ ( '<li/>' ) . append (
419
+ $ ( '<a/>' )
420
+ . attr ( 'href' , url )
421
+ . text ( path_part )
422
+ . click ( function ( e ) {
423
+ // Allow the default browser action when the user holds a modifier (e.g., Ctrl-Click)
424
+ if ( e . altKey || e . metaKey || e . shiftKey ) {
425
+ return true ;
426
+ }
427
+ window . history . pushState (
428
+ { path : path } ,
429
+ path ,
430
+ url
431
+ ) ;
432
+ that . update_location ( path ) ;
433
+ return false ;
434
+ } )
435
+ ) ;
419
436
breadcrumb . append ( crumb ) ;
420
437
} ) ;
421
438
this . contents . list_contents ( that . notebook_path ) . then (
0 commit comments