Blame view

controllets/paper-card-controllet/paper-card-controllet.html 6.14 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;

eb240478   Luigi Serra   public room cards...
21
22
23
              }

  

              paper-material {

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

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

eb240478   Luigi Serra   public room cards...
26
27
              }

  

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

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

7383b38e   Luigi Serra   paper-card-contro...
30
                  /*margin-bottom: 24px;*/

eb240478   Luigi Serra   public room cards...
31
              }

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

eb240478   Luigi Serra   public room cards...
33
              .legend {

7383b38e   Luigi Serra   paper-card-contro...
34
35
36
37
                  position: relative;

                  top: -50px;

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

                  bottom: 0;

eb240478   Luigi Serra   public room cards...
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
                  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...
54
                  padding: 0 16px 8px;

eb240478   Luigi Serra   public room cards...
55
56
57
58
59
                  font-weight: 300;

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

                  line-height: 24px;

                  max-height: 400px;

                  position:relative;

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

eb240478   Luigi Serra   public room cards...
61
62
63
64
65
66
67
68
              }

              ::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...
69
70
71
72
  

              #text{

                  position:relative;

                  top: -50px;

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

7383b38e   Luigi Serra   paper-card-contro...
74
75
76
77
78
79
                  height: auto;

                  padding: 8px 8px 8px 8px;

                  font-size: 10px;

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

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

              }

eb240478   Luigi Serra   public room cards...
80
81
82
83
          </style>

  

  

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

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

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

7383b38e   Luigi Serra   paper-card-contro...
86
87
88
                  <div id="content">

                      <content></content>

                  </div>

eb240478   Luigi Serra   public room cards...
89
  

6f8e74f7   Luigi Serra   card update
90
                  <template is="dom-if" if="{{legend}}">

eb240478   Luigi Serra   public room cards...
91
  

6f8e74f7   Luigi Serra   card update
92
93
94
                      <div class="legend horizontal layout center">

                          <span>{{legend}}</span>

                          <!-- Adding icon based on card type -->

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

6f8e74f7   Luigi Serra   card update
96
                          <template is="dom-if" if="{{checkType(type, 'text')}}">

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

e71c3328   Luigi Serra   selection control...
98
                              <paper-fab mini icon="create" on-click="_handleDetailsClick"></paper-fab>

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

6f8e74f7   Luigi Serra   card update
100
                          </template>

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

6f8e74f7   Luigi Serra   card update
102
                          <template is="dom-if" if="{{checkType(type, 'image')}}">

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

e71c3328   Luigi Serra   selection control...
104
                              <paper-fab mini icon="perm-media" on-click="_handleDetailsClick"></paper-fab>

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

6f8e74f7   Luigi Serra   card update
106
                          </template>

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

6f8e74f7   Luigi Serra   card update
108
                          <template is="dom-if" if="{{checkType(type, 'datalet')}}">

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

e71c3328   Luigi Serra   selection control...
110
                              <paper-fab mini icon="assessment" on-click="_handleDetailsClick"></paper-fab>

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

6f8e74f7   Luigi Serra   card update
112
                          </template>

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

6f8e74f7   Luigi Serra   card update
114
                          <template is="dom-if" if="{{checkType(type, 'link')}}">

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

e71c3328   Luigi Serra   selection control...
116
                              <paper-fab mini icon="link" on-click="_handleDetailsClick"></paper-fab>

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

6f8e74f7   Luigi Serra   card update
118
                          </template>

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

6f8e74f7   Luigi Serra   card update
120
                      </div>

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

6f8e74f7   Luigi Serra   card update
122
                  </template>

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

6f8e74f7   Luigi Serra   card update
124
125
126
                  <div class="footer">

                      <template is="dom-if" if="{{text}}">

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

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

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

eb240478   Luigi Serra   public room cards...
129
  

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

          </paper-material>

eb240478   Luigi Serra   public room cards...
132
  

1b49624d   isisadmin   paper-card-contro...
133
134
      </template>

  

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

  

1b49624d   isisadmin   paper-card-contro...
137
138
      <script>

          Polymer({

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

1b49624d   isisadmin   paper-card-contro...
140
141
142
              properties: {

                  width: {

                      type: Number,

1b49624d   isisadmin   paper-card-contro...
143
144
                      observer: "_changeWidth",

                  },

eb240478   Luigi Serra   public room cards...
145
146
147
148
149
150
151
                  height: {

                      type: Number,

                      observer: "_changeHeight",

                  },

                  type:{

                      type: String,

                      value: "text"

6f8e74f7   Luigi Serra   card update
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
                  },

                  text:{

                      type: String,

                      value: ""

                  },

                  legend:{

                      type: String,

                      value: ""

                  }

  

              },

  

              ready: function(){

                  if(this.type == "text"){

                      this.$.content.style.backgroundColor = "#ffc";

eb240478   Luigi Serra   public room cards...
167
                  }

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

eb240478   Luigi Serra   public room cards...
169
  

1b49624d   isisadmin   paper-card-contro...
170
171
              _changeWidth: function(data){

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

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

eb240478   Luigi Serra   public room cards...
173
174
175
176
                  //$(this.$.content).perfectScrollbar();

              },

  

              _changeHeight: function(data){

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

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

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

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

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

eb240478   Luigi Serra   public room cards...
182
183
184
  

              checkType: function(type, check){

                  return (type == check);

9d4a34db   Luigi Serra   selection control...
185
186
              },

  

e71c3328   Luigi Serra   selection control...
187
188
              _handleDetailsClick: function(e){

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

eb240478   Luigi Serra   public room cards...
189
              }

1b49624d   isisadmin   paper-card-contro...
190
191
192
          })

      </script>

  

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