-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathalert-banner.html
54 lines (52 loc) · 1.59 KB
/
alert-banner.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
46
47
48
49
50
51
52
53
54
<link rel="import" href="../polymer/polymer.html">
<dom-module id="alert-banner">
<style>
:host {
display: block;
padding: 20px 10px;
margin: 0;
background: #64c523;
color: #fff;
font-weight: 300;
font-size: 20px;
font-family: Roboto, Helvetica, sans-serif, Arial;
position: relative;
top: 20px;
left: 0;
}
div.overlay {
background: transparent;
position: absolute;
height: 100%;
width: 100%;
top: 0;
left: 0;
}
</style>
<template>
<content id="content"></content>
<div class="overlay" hidden="{{noselect}}"></div>
</template>
</dom-module>
<script>
Polymer({
is: "alert-banner",
ready: function () {
if (typeof (this.bg) !== "undefined") {
this.style.background = this.bg;
}
if (typeof (this.color) !== "undefined") {
this.style.color = this.color;
}
if( this.noselect=="") {
this.noselect=true;
}
console.log(this.bg, this.color, this.noselect);
},
properties: {
bg: "", //background for banner
color: "", //text-color for banner
noselect: false //noselect means the content of the banner is not selectable
}
});
</script>