-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathxenon-subheader.html
45 lines (45 loc) · 1.53 KB
/
xenon-subheader.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<link rel="import" href="../polymer/polymer.html">
<!--
`<xenon-subheader>` this element has docs
Example:
<xenon-subheader heading="This is a subhead">
<actions>
<iron-icon icon="add" title="Add Item" on-tap="_onAddItemTap"></iron-icon>
</actions>
</xenon-subheader>
@element xenon-subheader
@demo demo/index.html
-->
<dom-module id="xenon-subheader">
<template>
<style>
#heading { margin: 8px 0px 8px 0px; background-color:whitesmoke; height:2.4em; display:flex; align-items:center; padding:0px 8px 0px 8px; }
#actionarea { color:darkgray; }
</style>
<div id="heading">
<div id="headerText">
<template is="dom-if" if="{{showHeading}}">
<a href="[[href]]">[[heading]]</a>
</template>
<template is="dom-if" if="{{!showHeading}}">
[[heading]]
</template>
</div>
<div style="flex:1 1 auto"></div>
<div id="actionarea"><content select="actions"></content></div>
</div>
</template>
<script>
Polymer({
is: "xenon-subheader",
properties: {
heading: { type: String, reflectToAttribute: true },
href: { type: String, reflectToAttribute: true, observer: "inlineCheck" },
showHeading: { type: Boolean, value: false }
},
inlineCheck: function (href) {
this.set("showHeading", true);
}
});
</script>
</dom-module>