-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo-text-el.html
77 lines (69 loc) · 1.98 KB
/
demo-text-el.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<link rel="import" href="../content-editor/content-editor.html">
<!-- this is a demo element that is being rendered by row-adder element -->
<dom-module id="demo-text-el">
<style>
:host {
display: block;
}
div{
background: cyan;
color: black;
font-size: 16px;
}
h4 {
max-width: 400px;
}
.left {
text-align: left;
}
.center {
text-align: center;
}
.right {
text-align: right;
}
</style>
<template>
<div>
<h4 is-content="inline" content-id="heading">Some Random Demo Heading</h4>
<div class$="[[alignClass]]" is-content="wsywig" content-id="usual-paragraph">Some random wsywig field</div>
<button on-click="handleClick">Go to next page</button>
</div>
</template>
<script>
Polymer({
is: 'demo-text-el',
behaviors: [
ContentEditorBehavior
],
properties: {
align: {
type: Number,
value: 0
},
alignClass: {
type: String,
computed: 'generateClassName(align)'
},
usercontent: {
type: Object,
notify: true,
reflectToAttribute: false
}
},
generateClassName: function(num) {
switch(num) {
case 0: return 'left';
case 1: return 'center';
case 2: return 'right';
}
},
handleClick: function() {
this.fire('iron-signal', {
name: 'pancake-player-route-changed',
data: '/pages/en-US/product-page'
});
}
});
</script>
</dom-module>