File tree Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Expand file tree Collapse file tree 5 files changed +14
-12
lines changed Original file line number Diff line number Diff line change 432
432
// is in inNodes, if any
433
433
var n = inTarget ;
434
434
while ( n && n != this ) {
435
- var i = inNodes . indexOf ( n ) ;
435
+ var i = Array . prototype . indexOf . call ( inNodes , n ) ;
436
436
if ( i >= 0 ) {
437
437
return i ;
438
438
}
Original file line number Diff line number Diff line change 5
5
* license that can be found in the LICENSE file.
6
6
*/
7
7
-->
8
- < element name ="g-menuitem " attributes ="src ">
8
+ < element name ="g-menuitem " attributes ="src, label ">
9
9
< link rel ="components " href ="g-component.html ">
10
10
< link rel ="components " href ="g-icon.html ">
11
11
< link rel ="stylesheet " href ="css/g-menuitem.css " />
12
12
< template >
13
13
< g-icon id ="icon "> </ g-icon >
14
14
< div class ="label ">
15
+ < span id ="label "> </ span >
15
16
< content > </ content >
16
17
</ div >
17
18
</ template >
20
21
prototype : {
21
22
srcChanged : function ( ) {
22
23
this . $ . icon . src = this . src ;
24
+ } ,
25
+ labelChanged : function ( ) {
26
+ this . $ . label . textContent = this . label ;
23
27
}
24
28
}
25
29
} ) ;
Original file line number Diff line number Diff line change 10
10
< link rel ="components " href ="g-selection.html ">
11
11
< template >
12
12
< g-selection id ="selection " on-select ="selectionSelect " on-deselect ="selectionDeselect "> </ g-selection >
13
- < content id ="items "> </ content >
13
+ < content id ="items " select =" * " > </ content >
14
14
</ template >
15
15
< script >
16
16
this . component ( {
19
19
this . $ . selection . multi = this . multi ;
20
20
} ,
21
21
getItems : function ( ) {
22
- // TODO(sjmiles): distributedNodes not implemented natively yet
23
- // this.childNodes is LightDOM fallback which works unless we
24
- // are composited (in that case childNodes = <content>, and
25
- // distributeNodes is necessary to find the actual distributions)
26
- return this . $ . items . getDistributedNodes ( ) ||
27
- Array . prototype . slice . call ( this . childNodes , 0 ) ;
22
+ return this . $ . items . getDistributedNodes ( ) ;
23
+ } ,
24
+ getSelectedItem : function ( ) {
25
+ return this . $ . selection . getSelection ( ) ;
28
26
} ,
29
27
_valueToIndex : function ( inValue ) {
30
28
// find an item with value == inValue and return it's index
Original file line number Diff line number Diff line change 17
17
</ style >
18
18
</ head >
19
19
< body >
20
- < g-menu >
20
+ < g-menu selected =" 0 " >
21
21
< g-menuitem src ="images/edit_page.svg "> Post a Comment</ g-menuitem >
22
22
< g-menuitem src ="images/chat.svg "> Share Link</ g-menuitem >
23
23
< g-menuitem src ="images/email.svg "> Email Link</ g-menuitem >
Original file line number Diff line number Diff line change 6
6
< link rel ="components " href ="../../toolkit/src/g-tabs.html ">
7
7
</ head >
8
8
< body >
9
- < g-tabs >
9
+ < g-tabs selected =" 0 " >
10
10
< span > One</ span >
11
11
< span > Two</ span >
12
12
< span > Three</ span >
13
13
< span > Four</ span >
14
14
</ g-tabs >
15
15
< br > < br >
16
- < g-tabs vertical ="true ">
16
+ < g-tabs vertical ="true " selected =" 0 " >
17
17
< span > One</ span >
18
18
< span > Two</ span >
19
19
< span > Three</ span >
You can’t perform that action at this time.
0 commit comments