Blame view

controllets/paper-card-controllet/paper-card-controllet.html 6.94 KB
eb240478   Luigi Serra   public room cards...
1
  <link rel="import" href="../../bower_components/polymer/polymer.html"/>

1b49624d   isisadmin   paper-card-contro...
2
3
4
5
  <link rel="import" href="../../bower_components/paper-material/paper-material.html"/>

  <link rel="import" href="../../bower_components/paper-fab/paper-fab.html"/>

  <link rel="import" href="../../bower_components/iron-icons/iron-icons.html"/>

  

1b49624d   isisadmin   paper-card-contro...
6
7
  <dom-module id="paper-card-controllet">

  

1b49624d   isisadmin   paper-card-contro...
8
      <template>

eb240478   Luigi Serra   public room cards...
9
10
11
12
13
14
15
16
17
18
19
          <link rel="stylesheet" href="../shared_js/perfect-scrollbar/css/perfect-scrollbar.min.css">

          <link href='https://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>

          <style>

              :host {

                  display: inline-block;

                  margin: 0 8px 8px ;

                  font-size: 14px;

                  text-align: justify;

                  line-height: 10px;

                  --paper-fab-background: var(--accent-color);

                  font-family: 'Roboto', sans-serif;

6f8e74f7   Luigi Serra   card update
20
                  padding-bottom: 30px;

36f13d09   Luigi Serra   selection control...
21
22
23
  

                  /*Test*/

  

eb240478   Luigi Serra   public room cards...
24
25
26
              }

  

              paper-material {

eb240478   Luigi Serra   public room cards...
27
                  background-color: white;

7383b38e   Luigi Serra   paper-card-contro...
28
                  border-width: 1em;

eb240478   Luigi Serra   public room cards...
29
30
              }

  

7383b38e   Luigi Serra   paper-card-contro...
31
              .footer {

eb240478   Luigi Serra   public room cards...
32
                  position: relative;

36f13d09   Luigi Serra   selection control...
33
                  height: 21px;

eb240478   Luigi Serra   public room cards...
34
              }

7383b38e   Luigi Serra   paper-card-contro...
35
  

0fc2aafe   Luigi Serra   updates
36
              .legend {

7383b38e   Luigi Serra   paper-card-contro...
37
38
39
40
                  position: relative;

                  top: -50px;

                  background: rgba(0,0,0,0.8);

                  bottom: 0;

eb240478   Luigi Serra   public room cards...
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
                  color: white;

                  height: 50px;

                  padding: 0 16px;

                  left: 0; right: 0;

                  z-index: 1;

              }

              paper-fab {

                  position: absolute;

                  right: 10px;

                  bottom: -18px;

                  z-index: 10;

                  --paper-fab-background:#2196F3;

              }

  

              #content ::content {

                  /*padding: 0 16px 8px;*/

7383b38e   Luigi Serra   paper-card-contro...
57
                  padding: 0 16px 8px;

eb240478   Luigi Serra   public room cards...
58
59
60
61
62
                  font-weight: 300;

                  color: var(--secondary-text-color);

                  line-height: 24px;

                  max-height: 400px;

                  position:relative;

7383b38e   Luigi Serra   paper-card-contro...
63
                  overflow: auto;

eb240478   Luigi Serra   public room cards...
64
65
66
67
68
69
70
71
              }

              ::content.buttons {

                  margin-top: 8px;

              }

              ::content paper-button, ::content paper-icon-button {

                  font-weight: 500;

                  color: var(--accent-color);

              }

7383b38e   Luigi Serra   paper-card-contro...
72
  

b047d169   Luigi Serra   updates
73
              #comment{

7383b38e   Luigi Serra   paper-card-contro...
74
75
                  position:relative;

                  top: -50px;

6f8e74f7   Luigi Serra   card update
76
                  min-height: 50px;

7383b38e   Luigi Serra   paper-card-contro...
77
78
79
80
81
82
                  height: auto;

                  padding: 8px 8px 8px 8px;

                  font-size: 10px;

                  color: rgba(0,0,0,0.4);

                  font-family: 'Roboto', sans-serif;

              }

36f13d09   Luigi Serra   selection control...
83
  

15509ec7   Luigi Serra   controllets and b...
84
              .delete{

36f13d09   Luigi Serra   selection control...
85
86
87
88
89
90
91
92
93
                  position: absolute;

                  top: -12px;

                  left: -12px;

                  --iron-icon-height: 18px;

                  --iron-icon-width: 18px;

                  width: 24px;

                  height: 24px;

                  --paper-fab-background:#cccccc;

              }

eb240478   Luigi Serra   public room cards...
94
95
96
97
          </style>

  

  

          <paper-material animated elevation="{{elevation}}" flex>

7383b38e   Luigi Serra   paper-card-contro...
98
  

15509ec7   Luigi Serra   controllets and b...
99
              <paper-fab class="delete" mini icon="delete" on-click="_handleDeleteClick"></paper-fab>

36f13d09   Luigi Serra   selection control...
100
  

1b49624d   isisadmin   paper-card-contro...
101
              <div class="vertical layout">

7383b38e   Luigi Serra   paper-card-contro...
102
103
104
                  <div id="content">

                      <content></content>

                  </div>

eb240478   Luigi Serra   public room cards...
105
  

0fc2aafe   Luigi Serra   updates
106
                  <template is="dom-if" if="{{cardTitle}}">

eb240478   Luigi Serra   public room cards...
107
  

0fc2aafe   Luigi Serra   updates
108
109
                      <div class="legend horizontal layout center">

                          <span>{{cardTitle}}</span>

6f8e74f7   Luigi Serra   card update
110
                          <!-- Adding icon based on card type -->

7383b38e   Luigi Serra   paper-card-contro...
111
  

4b412909   Luigi Serra   paper-card-contro...
112
                          <template is="dom-if" if="{{checkType(cardType, 'text')}}">

7383b38e   Luigi Serra   paper-card-contro...
113
  

15509ec7   Luigi Serra   controllets and b...
114
                              <paper-fab class="modify" mini icon="create" on-click="_handleDetailsClick"></paper-fab>

7383b38e   Luigi Serra   paper-card-contro...
115
  

6f8e74f7   Luigi Serra   card update
116
                          </template>

7383b38e   Luigi Serra   paper-card-contro...
117
  

4b412909   Luigi Serra   paper-card-contro...
118
                          <template is="dom-if" if="{{checkType(cardType, 'image')}}">

7383b38e   Luigi Serra   paper-card-contro...
119
  

15509ec7   Luigi Serra   controllets and b...
120
                              <paper-fab class="modify" mini icon="perm-media" on-click="_handleDetailsClick"></paper-fab>

7383b38e   Luigi Serra   paper-card-contro...
121
  

6f8e74f7   Luigi Serra   card update
122
                          </template>

7383b38e   Luigi Serra   paper-card-contro...
123
  

4b412909   Luigi Serra   paper-card-contro...
124
                          <template is="dom-if" if="{{checkType(cardType, 'datalet')}}">

7383b38e   Luigi Serra   paper-card-contro...
125
  

15509ec7   Luigi Serra   controllets and b...
126
                              <paper-fab class="modify" mini icon="assessment" on-click="_handleDetailsClick"></paper-fab>

7383b38e   Luigi Serra   paper-card-contro...
127
  

6f8e74f7   Luigi Serra   card update
128
                          </template>

7383b38e   Luigi Serra   paper-card-contro...
129
  

4b412909   Luigi Serra   paper-card-contro...
130
                          <template is="dom-if" if="{{checkType(cardType, 'link')}}">

7383b38e   Luigi Serra   paper-card-contro...
131
  

15509ec7   Luigi Serra   controllets and b...
132
                              <paper-fab class="modify" mini icon="link" on-click="_handleDetailsClick"></paper-fab>

7383b38e   Luigi Serra   paper-card-contro...
133
  

6f8e74f7   Luigi Serra   card update
134
                          </template>

7383b38e   Luigi Serra   paper-card-contro...
135
  

6f8e74f7   Luigi Serra   card update
136
                      </div>

7383b38e   Luigi Serra   paper-card-contro...
137
  

6f8e74f7   Luigi Serra   card update
138
                  </template>

7383b38e   Luigi Serra   paper-card-contro...
139
  

6f8e74f7   Luigi Serra   card update
140
                  <div class="footer">

59190a9b   Luigi Serra   update
141
142
                      <template is="dom-if" if="{{comment}}">

                         <div id="comment">{{comment}}</div>

eb240478   Luigi Serra   public room cards...
143
                      </template>

1b49624d   isisadmin   paper-card-contro...
144
                  </div>

eb240478   Luigi Serra   public room cards...
145
  

1b49624d   isisadmin   paper-card-contro...
146
147
              </div>

          </paper-material>

eb240478   Luigi Serra   public room cards...
148
  

1b49624d   isisadmin   paper-card-contro...
149
150
      </template>

  

eb240478   Luigi Serra   public room cards...
151
152
      <script src="../shared_js/perfect-scrollbar/js/min/perfect-scrollbar.jquery.min.js"></script>

  

1b49624d   isisadmin   paper-card-contro...
153
154
      <script>

          Polymer({

eb240478   Luigi Serra   public room cards...
155
              is: "paper-card-controllet",

1b49624d   isisadmin   paper-card-contro...
156
157
158
              properties: {

                  width: {

                      type: Number,

1b49624d   isisadmin   paper-card-contro...
159
160
                      observer: "_changeWidth",

                  },

eb240478   Luigi Serra   public room cards...
161
162
163
164
                  height: {

                      type: Number,

                      observer: "_changeHeight",

                  },

4b412909   Luigi Serra   paper-card-contro...
165
                  cardType:{

eb240478   Luigi Serra   public room cards...
166
167
                      type: String,

                      value: "text"

6f8e74f7   Luigi Serra   card update
168
                  },

59190a9b   Luigi Serra   update
169
                  comment:{

b7101429   Luigi Serra   paper-card-contro...
170
                      cardType: String,

67b280f4   Luigi Serra   search feature
171
                      value: ""

6f8e74f7   Luigi Serra   card update
172
                  },

0fc2aafe   Luigi Serra   updates
173
                  cardTitle:{

6f8e74f7   Luigi Serra   card update
174
                      type: String,

67b280f4   Luigi Serra   search feature
175
                      value: ""

b9dd9495   Luigi Serra   selection control...
176
177
178
179
                  },

                  elevation:{

                      type: Number,

                      value: 3

6f8e74f7   Luigi Serra   card update
180
181
182
183
184
                  }

  

              },

  

              ready: function(){

4b412909   Luigi Serra   paper-card-contro...
185
                  if(this.cardType == "text"){

6f8e74f7   Luigi Serra   card update
186
                      this.$.content.style.backgroundColor = "#ffc";

eb240478   Luigi Serra   public room cards...
187
                  }

1b49624d   isisadmin   paper-card-contro...
188
              },

eb240478   Luigi Serra   public room cards...
189
  

1b49624d   isisadmin   paper-card-contro...
190
191
              _changeWidth: function(data){

                  this.style.width = data + "px";

7383b38e   Luigi Serra   paper-card-contro...
192
                  //this.$.content.style.width = data + "px";

eb240478   Luigi Serra   public room cards...
193
194
195
196
                  //$(this.$.content).perfectScrollbar();

              },

  

              _changeHeight: function(data){

6f8e74f7   Luigi Serra   card update
197
                  this.style.height = (data) + "px";

7383b38e   Luigi Serra   paper-card-contro...
198
                  this.$.content.style.height = data + "px";

6f8e74f7   Luigi Serra   card update
199
200
                  this.style.height = (this.height + ((this.text != "") ? 50 : 0)) + "px";

                  $(this.$.content).perfectScrollbar();

1b49624d   isisadmin   paper-card-contro...
201
              },

eb240478   Luigi Serra   public room cards...
202
203
204
  

              checkType: function(type, check){

                  return (type == check);

9d4a34db   Luigi Serra   selection control...
205
206
              },

  

e71c3328   Luigi Serra   selection control...
207
208
              _handleDetailsClick: function(e){

                  this.fire('paper-card-controllet_details-clicked', {data : this});

36f13d09   Luigi Serra   selection control...
209
210
211
212
213
              },

  

              _handleDeleteClick: function(e){

              this.fire('paper-card-controllet_delete-clicked', {data : this});

          }

1b49624d   isisadmin   paper-card-contro...
214
215
216
          })

      </script>

  

1b49624d   isisadmin   paper-card-contro...
217
  </dom-module>