36
36
}
37
37
</ style >
38
38
< script src ="js/treegrid-1.js " type ="text/javascript "> </ script >
39
- < script >
40
- /* Init Script for TreeGrid */
41
- /* Get an object where each field represents a URL parameter */
42
- /* global TreeGrid */
43
- function getQuery ( ) {
44
- if ( ! getQuery . cached ) {
45
- getQuery . cached = { } ;
46
- const queryStr = window . location . search . substring ( 1 ) ;
47
- const vars = queryStr . split ( '&' ) ;
48
- for ( let i = 0 ; i < vars . length ; i ++ ) {
49
- const pair = vars [ i ] . split ( '=' ) ;
50
- // If first entry with this name
51
- getQuery . cached [ pair [ 0 ] ] = pair [ 1 ] && decodeURIComponent ( pair [ 1 ] ) ;
52
- }
53
- }
54
- return getQuery . cached ;
55
- }
56
-
57
- document . addEventListener ( 'DOMContentLoaded' , function ( ) {
58
- // Supports url parameter ?cell=force or ?cell=start (or leave out parameter)
59
- var cellParam = getQuery ( ) . cell ;
60
- var doAllowRowFocus = cellParam !== 'force' ;
61
- var doStartRowFocus = doAllowRowFocus && cellParam !== 'start' ;
62
- TreeGrid ( document . getElementById ( 'treegrid' ) , doAllowRowFocus , doStartRowFocus ) ;
63
- var choiceElem = document . getElementById ( 'option-cell-focus-' + ( cellParam || 'allow' ) ) ;
64
- choiceElem . setAttribute ( 'aria-current' , 'true' ) ;
65
- } ) ;
66
- </ script >
67
39
</ head >
68
40
< body >
69
41
< nav aria-label ="Related Links " class ="feedback ">
@@ -127,7 +99,9 @@ <h2>Example Usage Options</h2>
127
99
< li > A screen reader user can easily understand the UI when all information in a row is announced as a single string without any separation.</ li >
128
100
</ ul >
129
101
< section >
130
- < h2 id ="ex_label "> Example</ h2 >
102
+ < div class ="example-header ">
103
+ < h2 id ="ex_label "> Example</ h2 >
104
+ </ div >
131
105
< div role ="separator " id ="ex_start_sep " aria-labelledby ="ex_start_sep ex_label " aria-label ="Start of "> </ div >
132
106
<!--
133
107
Note the ID of the following div that contains the example HTML is used as a parameter for the sourceCode.add() function.
@@ -490,7 +464,7 @@ <h2 id="rps_label">Role, Property, State, and Tabindex Attributes</h2>
490
464
< section >
491
465
< h2 > Javascript and CSS Source Code</ h2 >
492
466
<!-- After the js and css files are named with the name of this example, change the href and text of the following 2 links to refer to the appropriate js and css files. -->
493
- < ul >
467
+ < ul id =" css_js_files " >
494
468
< li >
495
469
CSS:
496
470
< a href ="css/treegrid-1.css " type ="text/css "> treegrid-1.css</ a >
@@ -513,7 +487,7 @@ <h2 id="sc1_label">HTML Source Code</h2>
513
487
If you change the ID of either the 'ex1' div or the 'sc1' pre, be sure to update the sourceCode.add function parameters.
514
488
-->
515
489
< script >
516
- sourceCode . add ( 'sc1' , 'ex1' ) ;
490
+ sourceCode . add ( 'sc1' , 'ex1' , 'ex_label' , 'css_js_files' ) ;
517
491
sourceCode . make ( ) ;
518
492
</ script >
519
493
</ section >
0 commit comments