Skip to content

Commit 7c986e8

Browse files
author
Steve Orvell
committed
Merge pull request #52 from frankiefu/master
updated components for the new changes in g-component
2 parents 9899acd + 3622639 commit 7c986e8

7 files changed

+21
-21
lines changed

src/g-icon-button.html

+2-5
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* license that can be found in the LICENSE file.
66
*/
77
-->
8-
<element name="g-icon-button" attributes="src, active">
8+
<element name="g-icon-button" attributes="src active">
99
<link rel="components" href="g-icon.html">
1010
<template>
1111
<style>
@@ -15,16 +15,13 @@
1515
width: 40px;
1616
height: 40px;
1717
border: 1px solid transparent;
18-
padding: 9px;
19-
background: inherit;
18+
padding: 3px;
2019
cursor: pointer;
21-
-webkit-transition: none;
2220
}
2321

2422
@host:hover, @host.selected {
2523
border: 1px solid rgba(0,0,0,0.16);
2624
border-radius: 3px;
27-
background: inherit;
2825
opacity: 0.8;
2926
}
3027

src/g-icon.html

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,17 @@
1717
}
1818

1919
#icon {
20-
width: 21px;
21-
height: 21px;
20+
width: 32px;
21+
height: 32px;
2222
cursor: pointer;
2323
background: no-repeat center;
24-
background-size: contain;
2524
}
2625
</style>
2726
<div id="icon" style="background-image:url({{src}})"></div>
2827
</template>
2928
<script>
3029
/**
31-
* g-icon is a 21x21 glyph expressed as a background-image.
30+
* g-icon is a 32x32 glyph expressed as a background-image.
3231
* @module g-icon
3332
*/
3433
this.component();

src/g-menu-button.html

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
<link rel="components" href="g-overlay.html">
1212
<link rel="components" href="g-menu.html"/>
1313
<template>
14-
<g-icon-button id="button" on-click="toggle" src="{{src}}"></g-icon-button>
14+
<g-icon-button id="button" on-click="toggle" src="{{src}}" active="{{opened}}"></g-icon-button>
1515
<g-overlay id="overlay" class="slideup" opened="{{opened}}">
1616
<div class="arrow-border"></div>
1717
<div class="arrow"></div>
@@ -26,8 +26,7 @@
2626
publish: {
2727
//* Toggle the opened state of the dropdown.
2828
toggle: function() {
29-
this.$.overlay.toggle();
30-
this.$.button.active = this.$.overlay.opened;
29+
this.opened = !this.opened;
3130
},
3231
//* Returns the selected item.
3332
get selection() {

src/g-menu-item.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
@host {
1313
display: block;
1414
box-sizing: border-box;
15-
padding: 11px 10px;
15+
padding: 8px 10px;
1616
margin: 10px;
1717
border: 1px solid transparent;
1818
border-radius: 3px;

src/g-panels.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
*/
77
-->
88
<element name="g-panels" attributes="transition, selected, index"
9-
handlers="keydown: keydownHandler">
9+
on-keydown="keydownHandler">
1010
<link rel="components" href="g-component.html">
1111
<link rel="components" href="panel-transitions/g-panel-transition.html">
1212
<link rel="components" href="panel-transitions/g-keyframe-panel-transition.html">

src/g-ratings.html

+11-6
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* license that can be found in the LICENSE file.
66
*/
77
-->
8-
<element name="g-ratings" attributes="count, value">
8+
<element name="g-ratings" attributes="count value">
99
<link rel="components" href="g-component.html">
1010
<template>
1111
<style>
@@ -21,9 +21,14 @@
2121
background: url('images/star_full.svg') center no-repeat;
2222
}
2323
</style>
24-
<template iterate="stars">
25-
<span index="{{index}}" class="star {{starClass}}" on-click="starClick"></span>
26-
</template>
24+
<!-- FIXME(ffu): in MDV polyfill, setting a model on a template element does
25+
not cause the children to have the proper model. Workaround here to add a div
26+
at the top-level. -->
27+
<div>
28+
<template iterate="stars">
29+
<span index="{{index}}" class="star {{starClass}}" on-click="starClick"></span>
30+
</template>
31+
</div>
2732
</template>
2833
<script>
2934
this.component({
@@ -42,8 +47,8 @@
4247
s.starClass = i < this.value ? 'full' : '';
4348
}.bind(this));
4449
},
45-
starClick: function(e) {
46-
var s = e.currentTarget.model;
50+
starClick: function(inEvent, inDetail, inSender) {
51+
var s = inSender.model;
4752
this.node.value = s.index + (s.starClass == 'full' ? 0 : 1);
4853
}
4954
});

src/g-tabs.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* license that can be found in the LICENSE file.
66
*/
77
-->
8-
<element name="g-tabs" extends="g-selector" attributes="selected multi vertical" on-click="clickHandler">
8+
<element name="g-tabs" extends="g-selector" attributes="selected multi vertical">
99
<link rel="components" href="g-selector.html">
1010
<template>
1111
<style>

0 commit comments

Comments
 (0)