File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11PATH
22 remote: .
33 specs:
4- jekyll-theme-conference (3.7.1 )
4+ jekyll-theme-conference (3.7.2 )
55 jekyll (~> 4.0 )
66
77GEM
Original file line number Diff line number Diff line change @@ -6,33 +6,28 @@ window.conference.program = (() => {
66 } ;
77
88 const init = ( ) => {
9- if ( $ ( "#day-list" ) ) {
10- // Switch to day if page load with hash
11- const hash = window . location . hash ;
12- if ( hash ) {
13- $ ( '#day-list a[href="' + hash + '"]' ) . tab ( "show" ) ;
14- }
9+ const $dayList = $ ( '#day-list' ) ;
10+ if ( ! $dayList . length ) return ;
1511
16- // Switch to day if today
17- else {
18- const now = new Date ( ) ;
19- const tsNow = Math . floor ( now . getTime ( ) / 1000 ) ;
20-
21- $ ( 'a[data-toggle="tab"]' ) . each ( function ( ) {
22- const tsMidnight = new Date ( $ ( this ) . data ( "ts" ) * 1000 ) ;
23-
24- if ( tsMidnight <= tsNow < tsMidnight + 24 * 60 * 60 ) {
25- $ ( this ) . tab ( "show" ) ;
26- updateHash ( this . hash ) ;
27- }
28- } ) ;
29- }
30-
31- // Add current selected day as hash to URL while keeping current scrolling position
32- $ ( 'a[data-toggle="tab"]' ) . on ( "shown.bs.tab" , function ( ) {
33- updateHash ( this . hash ) ;
12+ const hash = window . location . hash ;
13+ if ( hash ) {
14+ $ ( `a[data-toggle="tab"][href="${ hash } "]` ) . tab ( 'show' ) ;
15+ } else {
16+ const tsNow = Date . now ( ) / 1000 | 0 ;
17+ $ ( 'a[data-toggle="tab"]' ) . each ( function ( ) {
18+ const tsMidnight = $ ( this ) . data ( "ts" ) ;
19+ if ( tsMidnight && tsMidnight <= tsNow && tsNow < tsMidnight + 24 * 60 * 60 ) {
20+ $ ( this ) . tab ( 'show' ) ;
21+ updateHash ( this . hash ) ;
22+ return false ;
23+ }
3424 } ) ;
3525 }
26+
27+ // Add current selected day as hash to URL while keeping current scrolling position
28+ $ ( 'a[data-toggle="tab"]' ) . on ( 'shown.bs.tab' , function ( ) {
29+ updateHash ( this . hash ) ;
30+ } ) ;
3631 } ;
3732
3833 return {
Original file line number Diff line number Diff line change 22
33Gem ::Specification . new do |spec |
44 spec . name = "jekyll-theme-conference"
5- spec . version = "3.7.1 "
5+ spec . version = "3.7.2 "
66 spec . authors = [ "Lorenz Schmid" ]
77 spec . email = [ "lorenzschmid@users.noreply.github.com" ]
88
You can’t perform that action at this time.
0 commit comments