Blame view

controllets/select-dataset-controllet/select-dataset-controllet.html 7.82 KB
fb05b400   Renato De Donato   controllet 2.0, n...
1
2
3
  <link rel="import" href="../../bower_components/polymer/polymer.html">
  <link rel="import" href="../../bower_components/iron-flex-layout/iron-flex-layout.html">
  <!--<link rel="import" href="../../bower_components/app-layout/app-toolbar/app-toolbar.html">-->
a748d9bc   Renato De Donato   ala NUMBER bug
4
  <link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
fb05b400   Renato De Donato   controllet 2.0, n...
5
6
7
  <link rel="import" href="../../bower_components/paper-styles/color.html">
  <link rel="import" href="../../bower_components/paper-styles/typography.html">
  <link rel="import" href="../../bower_components/iron-ajax/iron-ajax.html">
a748d9bc   Renato De Donato   ala NUMBER bug
8
  <link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
fb05b400   Renato De Donato   controllet 2.0, n...
9
10
  <link rel="import" href="../../bower_components/iron-image/iron-image.html">
  <link rel="import" href="../../bower_components/iron-list/iron-list.html">
a748d9bc   Renato De Donato   ala NUMBER bug
11
  
a748d9bc   Renato De Donato   ala NUMBER bug
12
  
fb05b400   Renato De Donato   controllet 2.0, n...
13
  <dom-module id="select-dataset-controllet">
a748d9bc   Renato De Donato   ala NUMBER bug
14
      <template>
fb05b400   Renato De Donato   controllet 2.0, n...
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
          <style>
              /*:host {*/
                  /*display: block;*/
              /*@apply(--paper-font-common-base);*/
              /*}*/
              /*app-toolbar {*/
                  /*background-color: var(--google-green-700);*/
                  /*box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.3);*/
                  /*font-weight: bold;*/
                  /*color: white;*/
                  /*z-index: 1;*/
                  /*position: fixed;*/
                  /*top: 0;*/
                  /*left: 0;*/
                  /*right: 0;*/
              /*}*/
              /*app-toolbar paper-icon-button {*/
                  /*--paper-icon-button-ink-color: white;*/
              /*}*/
              /*iron-list {*/
                  /*padding-top: 64px;*/
              /*--iron-list-items-container: {*/
                   /*max-width: 800px;*/
                   /*margin: auto;*/
                   /*margin-top: 60px;*/
                   /*margin-bottom: 60px;*/
                   /*border-bottom: 1px solid #ddd;*/
               /*};*/
              /*}*/
              .item {
              @apply(--layout-horizontal);
                  padding: 16px;
                  background-color: #FFFFFF;
                  border: 1px solid #B6B6B6;/*2196F3*/
                  cursor: pointer;
                  margin-bottom: 8px;
                  /*border-radius: 8px;*/
              }
  
              /*.avatar {*/
                  /*height: 40px;*/
                  /*width: 40px;*/
                  /*border-radius: 20px;*/
                  /*box-sizing: border-box;*/
                  /*background-color: #DDD;*/
              /*}*/
              .pad {
                  /*padding: 0 16px;*/
              @apply(--layout-flex);
              @apply(--layout-vertical);
              }
              .primary {
                  /*font-size: 16px;*/
                  font-weight: bold;
                  /*padding-top: 5px;*/
              }
              .shortText/*, .longText*/ {
a748d9bc   Renato De Donato   ala NUMBER bug
72
                  font-size: 16px;
a748d9bc   Renato De Donato   ala NUMBER bug
73
              }
fb05b400   Renato De Donato   controllet 2.0, n...
74
75
76
              .longText {
                  color: gray;
                  display: none;
a748d9bc   Renato De Donato   ala NUMBER bug
77
              }
fb05b400   Renato De Donato   controllet 2.0, n...
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
              .item:hover .shortText::after {
                  content: ' [+]';
                  color: gray;
              }
              .item.expanded:hover .shortText::after {
                  content: '';
              }
              .item.expanded .longText {
                  display: block;
              }
              .item.expanded:hover .longText::after {
                  content: ' [–]';
              }
              /*.spacer {*/
              /*@apply(--layout-flex);*/
              /*}*/
              /*@media (max-width: 460px) {*/
                  /*paper-toolbar .bottom.title {*/
                      /*font-size: 14px;*/
                  /*}*/
              /*}*/
  
              /*.item.selected {*/
                  /*border: 1px solid #2196F3;/!**!/*/
              /*}*/
  
              #list_container {
                  /*background-color: #ccc;*/
                  height: 100%;
                  width: calc(100% - 16px);
                  /*overflow: scroll;*/
a748d9bc   Renato De Donato   ala NUMBER bug
109
                  position: relative;
a748d9bc   Renato De Donato   ala NUMBER bug
110
  
fb05b400   Renato De Donato   controllet 2.0, n...
111
112
113
                  font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
                  font-size: 16px;
                  line-height: 24px;/*???*/
a748d9bc   Renato De Donato   ala NUMBER bug
114
  
fb05b400   Renato De Donato   controllet 2.0, n...
115
                  margin: 8px;
a748d9bc   Renato De Donato   ala NUMBER bug
116
  
a748d9bc   Renato De Donato   ala NUMBER bug
117
118
              }
  
fb05b400   Renato De Donato   controllet 2.0, n...
119
120
121
122
              #select_dataset_container {
                 /*padding: 8px;*/
                  /*background-color: #B6B6B6;*/
                  border: 4px solid #B6B6B6;/*2196F3*/
a748d9bc   Renato De Donato   ala NUMBER bug
123
124
              }
  
fb05b400   Renato De Donato   controllet 2.0, n...
125
126
127
128
129
              #toolbar {
                  /*padding: 8px;*/
                  /*background-color: #B6B6B6;*/
                  width: calc(100% - 12px);
                  height: 20px;
a748d9bc   Renato De Donato   ala NUMBER bug
130
                  background-color: #B6B6B6;
a748d9bc   Renato De Donato   ala NUMBER bug
131
  
fb05b400   Renato De Donato   controllet 2.0, n...
132
133
134
135
136
137
138
                  font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
                  font-size: 16px;
                  font-weight: bold;
                  /*line-height: 24px;*/
                  padding-left: 12px;
                  padding-top: 12px;
                  padding-bottom: 12px;
a748d9bc   Renato De Donato   ala NUMBER bug
139
              }
fb05b400   Renato De Donato   controllet 2.0, n...
140
141
              .ssssssssseeeel {
                  background-color: red;
a748d9bc   Renato De Donato   ala NUMBER bug
142
143
              }
  
a748d9bc   Renato De Donato   ala NUMBER bug
144
145
          </style>
  
fb05b400   Renato De Donato   controllet 2.0, n...
146
          <div id="select_dataset_container">
a748d9bc   Renato De Donato   ala NUMBER bug
147
  
fb05b400   Renato De Donato   controllet 2.0, n...
148
149
              <div id="toolbar">
                  AVAILABLE DATASETS
a748d9bc   Renato De Donato   ala NUMBER bug
150
  
a748d9bc   Renato De Donato   ala NUMBER bug
151
152
              </div>
  
fb05b400   Renato De Donato   controllet 2.0, n...
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
              <div id="list_container">
  
                  <!--<iron-ajax url="data/contacts.json" last-response="{{items}}" auto></iron-ajax>-->
  
                  <!--<app-toolbar>-->
                      <!--<div title>Collapsable items</div>-->
                      <!--<paper-icon-button icon="search" alt="Search"></paper-icon-button>-->
                      <!--<paper-icon-button icon="more-vert" alt="More options"></paper-icon-button>-->
                  <!--</app-toolbar>-->
  
                  <iron-list id="list" items="[[items]]" as="item" selection-enabled><!--multi-selection-->
                      <template>
                          <div>
                              <div class$="[[getClassForItem(item, selected)]]" tabindex$="[[tabIndex]]" on-tap="_prova">
                                  <!--<iron-image class="avatar" sizing="contain" src="[[item.image]]"></iron-image>-->
                                  <div class="pad">
                                      <div class="primary">[[item.name]]</div>
                                      <!--<div class="shortText">[[item.url]]</div>-->
                                      <!--substring description-->
                                      <div class="longText">[[item.description]]</div>
                                  </div>
                                  <iron-icon icon$="[[iconForItem(item)]]"></iron-icon>
a748d9bc   Renato De Donato   ala NUMBER bug
175
176
177
                              </div>
                          </div>
                      </template>
fb05b400   Renato De Donato   controllet 2.0, n...
178
                  </iron-list>
a748d9bc   Renato De Donato   ala NUMBER bug
179
180
181
  
              </div>
  
a748d9bc   Renato De Donato   ala NUMBER bug
182
183
184
185
186
          </div>
  
      </template>
  
      <script>
fb05b400   Renato De Donato   controllet 2.0, n...
187
188
189
190
191
192
193
194
195
196
197
198
          HTMLImports.whenReady(function() {
              Polymer({
                  is: 'select-dataset-controllet',
                  properties: {
                      items: {
                          type: Array,
                          value: [
  //                            {"name": "Bob"},
  //                            {"name": "Tim"},
  //                            {"name": "Mike"}
                          ]
                      }
a748d9bc   Renato De Donato   ala NUMBER bug
199
                  },
fb05b400   Renato De Donato   controllet 2.0, n...
200
201
                  ready : function() {
                      $(this.$.list_container).perfectScrollbar();
a748d9bc   Renato De Donato   ala NUMBER bug
202
                  },
fb05b400   Renato De Donato   controllet 2.0, n...
203
204
205
                  _prova : function(e) {
  //                   console.log(e.target);
  //                    e.target.style.background = "#B6B6B6";
a748d9bc   Renato De Donato   ala NUMBER bug
206
207
                  },
  
fb05b400   Renato De Donato   controllet 2.0, n...
208
209
210
                  attached: function() {
                      // Use the document element
                      this.$.list.scrollTarget = this.ownerDocument.documentElement;
a748d9bc   Renato De Donato   ala NUMBER bug
211
                  },
fb05b400   Renato De Donato   controllet 2.0, n...
212
213
                  iconForItem: function(item) {
                      return item ? (item.integer < 50 ? 'star-border' : 'info-outline') : '';
a748d9bc   Renato De Donato   ala NUMBER bug
214
                  },
fb05b400   Renato De Donato   controllet 2.0, n...
215
216
217
218
                  getClassForItem: function(item, selected) {
                      console.log(item);
                      console.log(selected);
                      return selected ? 'item expanded' : 'item';
a748d9bc   Renato De Donato   ala NUMBER bug
219
                  }
fb05b400   Renato De Donato   controllet 2.0, n...
220
              });
a748d9bc   Renato De Donato   ala NUMBER bug
221
          });
a748d9bc   Renato De Donato   ala NUMBER bug
222
      </script>
a748d9bc   Renato De Donato   ala NUMBER bug
223
  </dom-module>