File tree Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Expand file tree Collapse file tree 4 files changed +31
-5
lines changed Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ This will be in a separate paragraph.
2323 
2424 <img src="logo.gif" />
2525
26+ [ Here's a link] ( http://google.com ) .
27+
2628--
2729
2830### A list of things
@@ -31,7 +33,7 @@ This will be in a separate paragraph.
3133* Item B
3234* Item gamma
3335
34- No need for multiple templates!
36+ No need for multiple templates! [ Another link ] ( http://google.com ) .
3537
3638--
3739
Original file line number Diff line number Diff line change 11{
22 "name" : " cleaver" ,
33 "preferGlobal" : true ,
4- "version" : " 0.4.1 " ,
4+ "version" : " 0.4.2 " ,
55 "author" : " Jordan Scales <scalesjordan@gmail.com>" ,
66 "description" : " 30-second slideshows for hackers" ,
77 "keywords" : [
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ function goBack() {
1313
1414 setCurrentProgress ( ) ;
1515 updateURL ( ) ;
16+ updateTabIndex ( ) ;
1617}
1718
1819/**
@@ -30,6 +31,7 @@ function goForward() {
3031
3132 setCurrentProgress ( ) ;
3233 updateURL ( ) ;
34+ updateTabIndex ( ) ;
3335}
3436
3537/**
@@ -99,11 +101,33 @@ function goToPage(page) {
99101 }
100102}
101103
104+ /**
105+ * Removes tabindex property from all links on the current slide, sets
106+ * tabindex = -1 for all links on other slides. Prevents slides from appearing
107+ * out of control.
108+ */
109+ function updateTabIndex ( ) {
110+ var allLinks = document . querySelectorAll ( '.slide a' ) ;
111+ var currentPageLinks = document . querySelector ( '.slide' ) . querySelectorAll ( 'a' ) ;
112+ var i ;
113+
114+ for ( i = 0 ; i < allLinks . length ; i ++ ) {
115+ allLinks [ i ] . setAttribute ( 'tabindex' , - 1 ) ;
116+ }
117+
118+ for ( i = 0 ; i < currentPageLinks . length ; i ++ ) {
119+ allLinks [ i ] . removeAttribute ( 'tabindex' ) ;
120+ }
121+ }
122+
102123window . onload = function ( ) {
103124
104125 // Give each slide a "page" data attribute.
105126 setPageNumbers ( ) ;
106127
128+ // Update the tabindex to prevent weird slide transitioning
129+ updateTabIndex ( ) ;
130+
107131 // If the location hash specifies a page number, go to it.
108132 var page = window . location . hash . slice ( 1 ) ;
109133 if ( page ) goToPage ( page ) ;
Original file line number Diff line number Diff line change 22 <h1 class =" name" >{ {name} }</h1 >
33 { {#twitter} }
44 <h3 class =" twitter" >
5- <a href =" http://twitter.com/{ { { twitter} } } " tabindex = " -1 " >{ {{twitter} }}</a >
5+ <a href =" http://twitter.com/{ { { twitter} } } " >{ {{twitter} }}</a >
66 </h3 >
77 { {/twitter} }
88 { {#url} }
99 <h3 class =" url" >
10- <a href =" { { { url} } } " tabindex = " -1 " >{ {{url} }}</a >
10+ <a href =" { { { url} } } " >{ {{url} }}</a >
1111 </h3 >
1212 { {/url} }
1313 { {#email} }
1414 <h3 class =" email" >
15- <a href =" mailto:{ { { email} } } " tabindex = " -1 " >{ {{email} }}</a >
15+ <a href =" mailto:{ { { email} } } " >{ {{email} }}</a >
1616 </h3 >
1717 { {/email} }
1818</div >
You can’t perform that action at this time.
0 commit comments