File tree Expand file tree Collapse file tree 5 files changed +24
-23
lines changed Expand file tree Collapse file tree 5 files changed +24
-23
lines changed Original file line number Diff line number Diff line change 45
45
</ div >
46
46
</ li >
47
47
< % IF module.sloc > 0 %>
48
- < li > < div > < a href =" javascript: togglePod(<% module.pod_lines.json %> ) "> < i class ="fa fa-exchange fa-fw black "> </ i > Toggle pod</ a > </ div > </ li >
48
+ < li > < div > < button class =" btn-link " onclick =" togglePod() "> < i class ="fa fa-exchange fa-fw black "> </ i > Toggle pod</ button > </ div > </ li >
49
49
< % END %>
50
50
< li class ="nav-header "> Info</ li >
51
51
< li > < % module.sloc %> lines of code</ li >
67
67
//SyntaxHighlighter.all();
68
68
$ ( document ) . ready ( function ( ) {
69
69
< % IF module . sloc > 0 %>
70
- togglePod ( < % module . pod_lines . json % > ) ;
70
+ setPodLines ( < % module . pod_lines . json % > ) ;
71
+ togglePod ( ) ;
71
72
< % END % >
72
73
if(document.location.hash)
73
74
document.location.href = document.location.href;
Original file line number Diff line number Diff line change @@ -26,26 +26,6 @@ $.extend({
26
26
}
27
27
} ) ;
28
28
29
- var podVisible = false ;
30
-
31
- function togglePod ( lines ) {
32
- var toggle = podVisible ? 'none' : 'block' ;
33
- podVisible = ! podVisible ;
34
- if ( ! lines || ! lines . length ) return ;
35
- for ( var i = 0 ; i < lines . length ; i ++ ) {
36
- var start = lines [ i ] [ 0 ] ,
37
- length = lines [ i ] [ 1 ] ;
38
- var sourceC = $ ( '.container' ) [ 0 ] . children ;
39
- var linesC = $ ( '.gutter' ) [ 0 ] . children ;
40
- var x ;
41
- for ( x = start ; x < start + length ; x ++ ) {
42
- sourceC [ x ] . style . display = toggle ;
43
- linesC [ x ] . style . display = toggle ;
44
- }
45
-
46
- }
47
- }
48
-
49
29
function togglePanel ( side ) {
50
30
var panel = $ ( '#' + side + '-panel' ) ;
51
31
var shower = $ ( '#show-' + side + '-panel' ) ;
Original file line number Diff line number Diff line change @@ -143,3 +143,20 @@ $(function () {
143
143
SyntaxHighlighter . highlight ( config , source ) ;
144
144
} ) ;
145
145
} ) ;
146
+
147
+ function setPodLines ( lines ) {
148
+ if ( ! lines || ! lines . length ) return ;
149
+ for ( var i = 0 ; i < lines . length ; i ++ ) {
150
+ var start = lines [ i ] [ 0 ] ;
151
+ var length = lines [ i ] [ 1 ] ;
152
+ var selectors = [ ] ;
153
+ for ( var x = start ; x < start + length ; x ++ ) {
154
+ selectors . push ( '.number' + ( x + 1 ) ) ;
155
+ }
156
+ $ ( '#source .syntaxhighlighter .line' ) . filter ( selectors . join ( ', ' ) ) . addClass ( 'pod-line' ) ;
157
+ }
158
+ }
159
+
160
+ function togglePod ( ) {
161
+ $ ( '.syntaxhighlighter' ) . toggleClass ( 'pod-hidden' ) ;
162
+ }
Original file line number Diff line number Diff line change 238
238
/* Contributors list on release pages
239
239
* see /release/Plack for example
240
240
*/
241
-
242
241
#contributors {
243
242
min-height : 40px ;
244
243
Original file line number Diff line number Diff line change @@ -24,3 +24,7 @@ pre code {
24
24
.syntaxhighlighter .container :after {
25
25
content : none !important ;
26
26
}
27
+
28
+ .pod-hidden .pod-line {
29
+ display : none ;
30
+ }
You can’t perform that action at this time.
0 commit comments