Blame view

controllets/datalet-selection-controllet/datalet-selection-controllet.html 19.7 KB
a31f0660   root   sevc-controllet i...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
  <link rel="import" href="../../bower_components/polymer/polymer.html" />
  
  <link rel="import" href="../../bower_components/paper-material/paper-material.html" />
  
  <link rel="import" href="../../bower_components/paper-dropdown-menu/paper-dropdown-menu.html">
  <link rel="import" href="../../bower_components/paper-menu/paper-menu.html">
  <link rel="import" href="../../bower_components/paper-item/paper-item.html">
  
  <link rel="import" href="../../bower_components/paper-icon-button/paper-icon-button.html">
  <link rel="import" href="../../bower_components/iron-icons/iron-icons.html">
  <link rel="import" href="../../bower_components/iron-icon/iron-icon.html">
  
  <link rel="import" href="../../bower_components/paper-input/paper-textarea.html">
  
  <link rel="import" href="../../bower_components/paper-button/paper-button.html">
  
57ef9bf4   Renato De Donato   labels + info
17
18
  <link rel="import" href="../../bower_components/paper-dialog/paper-dialog.html">
  
a31f0660   root   sevc-controllet i...
19
20
  <link rel="import" href="../items-vslider-controllet/items-vslider-controllet.html" />
  
0f6424fe   root   update new data-s...
21
  <script src="../../../DEEPCLIENT/js/deepClient.js"></script>
a31f0660   root   sevc-controllet i...
22
23
24
25
26
27
  
  <dom-module id="datalet-selection-controllet">
  
      <template>
  
          <style is="custom-style">
e0e4a976   Renato De Donato   data-sevc-control...
28
29
30
31
32
              :host {
              --paper-dropdown-menu-icon: {
                   color: #2196F3;
               };
              }
a31f0660   root   sevc-controllet i...
33
34
35
36
37
  
              #datalet_selection_container {
                  display: flex;
                  font-family: 'Roboto', 'Helvetica Neue', Helvetica, Arial, sans-serif;
                  font-size: 16px;
0f6424fe   root   update new data-s...
38
                  margin-top: 8px;
a31f0660   root   sevc-controllet i...
39
40
41
42
43
44
              }
  
              #datalet_selection_inputs {
                  position: relative;
                  height: 100vh;
                  margin-left: 32px;
e0e4a976   Renato De Donato   data-sevc-control...
45
46
                  /*width: 344px;*/
                  min-width: 258px;
a31f0660   root   sevc-controllet i...
47
48
49
50
51
52
              }
  
              #datalet_selection_labels {
                  position: relative;
                  height: 100vh;
                  margin-left: 32px;
e0e4a976   Renato De Donato   data-sevc-control...
53
54
                  /*width: 344px;*/
                  min-width: 258px;
a31f0660   root   sevc-controllet i...
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
              }
  
              #datalet_selection_column {
                  position: relative;
                  width: 100%;
                  margin-left: 32px;
              }
  
              #datalet_selection_datalet {
                  position: relative;
                  height: 100vh;
                  width: 100%;
                  /*margin-left: 32px;*/
                  /*margin-top: 32px;*/
                  /*margin-bottom: 32px;*/
              }
  
              #datalet_selection_comment{
                  width: 100%;
e0e4a976   Renato De Donato   data-sevc-control...
74
                  /*height: 112px;*/
a31f0660   root   sevc-controllet i...
75
76
77
78
79
80
81
82
83
84
85
86
87
                  margin-bottom: 32px;
              }
  
              #datalet_selection_datalet_placeholder {
                  padding: 16px;
              }
  
              .inputs{
                  position: relative;
                  /*margin-left: 16px;*/
                  /*margin-right: 16px;*/
              }
  
e0e4a976   Renato De Donato   data-sevc-control...
88
89
90
91
              /*.input_name{*/
                  /*height: 16px;*/
                  /*padding: 16px;*/
                  /*/!*background-color: #B6B6B6;*!/*/
a31f0660   root   sevc-controllet i...
92
  
e0e4a976   Renato De Donato   data-sevc-control...
93
94
95
96
                  /*background-color: #2196F3;*/
                  /*color: #FFFFFF;*/
                  /*font-weight: 700;*/
              /*}*/
a31f0660   root   sevc-controllet i...
97
98
  
              .input_header{
e0e4a976   Renato De Donato   data-sevc-control...
99
100
101
                  height: 32px;
                  padding-top: 16px;
                  /*padding: 16px;*/
a31f0660   root   sevc-controllet i...
102
103
104
105
106
107
                  background-color: #B6B6B6;
                  text-align: center;
                  font-weight: 700;
              }
  
              .info_button {
e0e4a976   Renato De Donato   data-sevc-control...
108
                  /*background-color: red;*/
a31f0660   root   sevc-controllet i...
109
                  position: absolute;
e0e4a976   Renato De Donato   data-sevc-control...
110
                  top: 18px;
a31f0660   root   sevc-controllet i...
111
112
113
114
                  right: 0px;
              }
  
              paper-textarea {
e0e4a976   Renato De Donato   data-sevc-control...
115
                  display: inline-block;
a31f0660   root   sevc-controllet i...
116
                  height: 48px;
e0e4a976   Renato De Donato   data-sevc-control...
117
118
119
120
                  /*padding: 0px 8px;*/
                  width: 210px;
                  padding-left: 8px;
                  padding-bottom: 8px;
a31f0660   root   sevc-controllet i...
121
122
123
                  --paper-input-container-focus-color: #2196F3;
              }
  
e0e4a976   Renato De Donato   data-sevc-control...
124
125
126
127
128
              #datalet_selection_comment paper-textarea {
                  padding-bottom: 0px;
                  width: calc(100% - 16px);
              }
  
a31f0660   root   sevc-controllet i...
129
              paper-dropdown-menu {
e0e4a976   Renato De Donato   data-sevc-control...
130
                  /*display: inline-block;*/
a31f0660   root   sevc-controllet i...
131
                  height: 48px;
e0e4a976   Renato De Donato   data-sevc-control...
132
133
134
135
                  width: 210px;;
                  /*padding: 0px 8px;*/
                  padding-left: 8px;
                  padding-bottom: 8px;
a31f0660   root   sevc-controllet i...
136
137
138
139
140
141
142
143
144
                  --paper-input-container-focus-color: #2196F3;
              }
  
              paper-item.iron-selected {
                  background-color: #2196F3;
                  color: #FFFFFF;
              }
  
              paper-icon-button {
e0e4a976   Renato De Donato   data-sevc-control...
145
146
147
                  /*display: inline-block;*/
                  color: #2196F3;
                  /*color: #FFFFFF;*/
a31f0660   root   sevc-controllet i...
148
                  --paper-icon-button-ink-color: #2196F3;
e0e4a976   Renato De Donato   data-sevc-control...
149
                  margin: 0px;
a31f0660   root   sevc-controllet i...
150
151
152
153
154
155
156
157
158
                  /*padding: 0px;*/
              }
  
              paper-button {
                  /*display: block;*/
                  position: absolute;
                  bottom: 16px;
                  right: 11px;
  
a31f0660   root   sevc-controllet i...
159
160
161
162
163
164
165
166
167
168
169
                  height: 48px;
                  width: 172px;
                  background-color: #00BCD4;
                  color: white;
                  font-weight: 700;
                  padding: 16px;
              }
  
              paper-button:hover {
                  background-color: #00AABF;
              }
0f6424fe   root   update new data-s...
170
171
172
173
  
              paper-button[disabled] {
                  background-color: #B6B6B6;
              }
57ef9bf4   Renato De Donato   labels + info
174
  
79ec939f   Renato De Donato   info position + a...
175
              #dialog_info_input {
57ef9bf4   Renato De Donato   labels + info
176
177
178
                  border: 2px solid #2196F3;
                  background-color: #E0E0E0;
              }
a31f0660   root   sevc-controllet i...
179
180
          </style>
  
0f6424fe   root   update new data-s...
181
          <iron-ajax id="selectedDatalet_request" on-response="_handleSelectedDatalet"></iron-ajax>
a31f0660   root   sevc-controllet i...
182
183
  
          <div id="datalet_selection_container">
e0e4a976   Renato De Donato   data-sevc-control...
184
              <items-vslider-controllet id="vslider" datalets-list-url={{dataletsListUrl}} preselected-datalet={{preselectedDatalet}}></items-vslider-controllet>
a31f0660   root   sevc-controllet i...
185
186
187
188
  
  
              <paper-material id="datalet_selection_inputs" elevation="5">
                  <div class="input_header">INPUTS</div>
e0e4a976   Renato De Donato   data-sevc-control...
189
                  <template is="dom-repeat" items="{{inputs}}" index-as="ddl_index">
a31f0660   root   sevc-controllet i...
190
                      <div class="inputs">
e0e4a976   Renato De Donato   data-sevc-control...
191
192
193
194
195
196
197
                          <!--<div class="input_name">-->
                              <!--{{item.name}}-->
                              <!--<div class="info_button">-->
                                  <!--<paper-icon-button id="info_button" on-click="_showInfo" icon="info-outline" title="{{item.name}} info"></paper-icon-button>-->
                              <!--</div>-->
                          <!--</div>-->
                          <paper-dropdown-menu id={{ddl_index}} label={{item.name}}>
a31f0660   root   sevc-controllet i...
198
                              <paper-menu class="dropdown-content">
e0e4a976   Renato De Donato   data-sevc-control...
199
200
                                  <template is="dom-repeat" items={{fields}}>
                                      <paper-item id={{index}} on-tap="_addInput">{{item}}</paper-item>
a31f0660   root   sevc-controllet i...
201
202
203
                                  </template>
                              </paper-menu>
                          </paper-dropdown-menu>
e0e4a976   Renato De Donato   data-sevc-control...
204
205
206
                          <div class="info_button">
                              <paper-icon-button id="info_button" on-click="_showInfo" icon="info-outline" title="{{item.name}} info"></paper-icon-button>
                          </div>
a31f0660   root   sevc-controllet i...
207
208
209
210
211
212
213
214
                      </div>
                  </template>
              </paper-material>
  
              <paper-material id="datalet_selection_labels" elevation="5">
                  <div class="input_header">LABELS</div>
                  <template is="dom-repeat" items="{{labels}}" index-as="index">
                      <div class="inputs">
e0e4a976   Renato De Donato   data-sevc-control...
215
216
217
218
219
220
221
222
223
                          <!--<div class="input_name">-->
                              <!--{{item.name}}-->
                              <!--<div class="info_button">-->
                                  <!--<paper-icon-button id="info_button" on-click="_showInfo" icon="info-outline" title="{{item.name}} info"></paper-icon-button>-->
                              <!--</div>-->
                          <!--</div>-->
                          <paper-textarea label={{item.name}}></paper-textarea>
                          <div class="info_button">
                              <paper-icon-button id="info_button" on-click="_showInfo" icon="info-outline" title="{{item.name}} info"></paper-icon-button>
a31f0660   root   sevc-controllet i...
224
                          </div>
a31f0660   root   sevc-controllet i...
225
226
227
228
229
230
                      </div>
                  </template>
              </paper-material>
  
  
              <div id="datalet_selection_column">
e0e4a976   Renato De Donato   data-sevc-control...
231
  
83faae2e   Renato De Donato   comment-modify
232
                  <!--<template is="dom-if" if={{modify}}>-->
e0e4a976   Renato De Donato   data-sevc-control...
233
234
235
236
                      <paper-material id="datalet_selection_comment" elevation="5">
                          <div class="input_header">COMMENT</div>
                          <paper-textarea id="comment" no-label-float maxlength="100" label="comment (max 100 characters)"></paper-textarea>
                      </paper-material>
83faae2e   Renato De Donato   comment-modify
237
                  <!--</template>-->
a31f0660   root   sevc-controllet i...
238
239
240
241
242
243
244
  
                  <paper-material id="datalet_selection_datalet" elevation="5">
                      <div class="input_header">DATALET PREVIEW</div>
                      <div id="datalet_selection_datalet_placeholder"></div>
  
                  </paper-material>
  
0f6424fe   root   update new data-s...
245
                  <paper-button id="add_button" disabled raised on-click="_addDatalet">ADD DATALET</paper-button>
a31f0660   root   sevc-controllet i...
246
247
248
  
              </div>
  
79ec939f   Renato De Donato   info position + a...
249
              <paper-dialog id="dialog_info_input">
57ef9bf4   Renato De Donato   labels + info
250
251
252
253
                  <h2 id="dialog_name"></h2>
                  <p id="dialog_description"></p>
              </paper-dialog>
  
a31f0660   root   sevc-controllet i...
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
          </div>
  
      </template>
  
      <script>
  
          Polymer({
  
              is : 'datalet-selection-controllet',
  
              properties : {
  
                  deepUrl : {
                      type : String,
                      value : undefined
                  },
  
                  dataletsListUrl : {
                      type : String,
                      value : undefined
                  },
  
                  selectedDatalet : {
                      type  : String,
                      value : undefined
                  },
  
e0e4a976   Renato De Donato   data-sevc-control...
281
282
283
284
285
                  preselectedDatalet : {
                      type  : String,
                      value : undefined
                  },
  
a31f0660   root   sevc-controllet i...
286
287
288
289
290
291
292
293
294
295
296
297
                  inputs : {
                      type : Array,
                      value : []
                  },
  
                  labels : {
                      type : Array,
                      value : []
                  },
  
                  fields : {
                      type : Array,
0f6424fe   root   update new data-s...
298
299
300
301
302
303
304
305
                      value : []
                  },
  
                  selectedFields : {
                      type : Array,
                      value : []
                  },
  
e0e4a976   Renato De Donato   data-sevc-control...
306
307
308
309
  //                selectableFields : {
  //                    type : Array,
  //                    value : []
  //                },
a31f0660   root   sevc-controllet i...
310
311
312
  
                  dataUrl : {
                      type  : String,
0f6424fe   root   update new data-s...
313
                      value : undefined
e0e4a976   Renato De Donato   data-sevc-control...
314
315
                  },
  
57ef9bf4   Renato De Donato   labels + info
316
317
318
319
320
                  params:{
                      type: Object,
                      value: undefined
                  },
  
e0e4a976   Renato De Donato   data-sevc-control...
321
322
323
                  modify : {
                      type  : Boolean,
                      value : false
a31f0660   root   sevc-controllet i...
324
325
326
327
328
                  }
  
              },
  
              listeners: {
e0e4a976   Renato De Donato   data-sevc-control...
329
                  'items-vslider-controllet_selected-datalet': '_selectDatalet'
0f6424fe   root   update new data-s...
330
  //                'tree-view-controllet_selected-fields': '_updateSelectedFields'
a31f0660   root   sevc-controllet i...
331
332
333
334
335
336
337
              },
  
              ready : function() {
                  this._resize();
                  $(this.$.datalet_selection_inputs).perfectScrollbar();
                  $(this.$.datalet_selection_labels).perfectScrollbar();
                  $(this.$.datalet_selection_datalet).perfectScrollbar();
0f6424fe   root   update new data-s...
338
  
fb432ae9   Renato De Donato   suggested
339
                  this.modify = true;//da eliminare in futuro
e0e4a976   Renato De Donato   data-sevc-control...
340
341
342
343
344
                  if(this.preselectedDatalet){
                      this.modify = true;
                      this._preselectDatalet();
                      this.preselectedDatalet = undefined;
                  }
57ef9bf4   Renato De Donato   labels + info
345
346
  
                  this.params = {'data-url' : this.dataUrl};
a31f0660   root   sevc-controllet i...
347
348
349
350
351
352
              },
  
              attached : function() {
                  this._resize();
                  var that = this;
                  window.addEventListener("resize", function() { that._resize(); });
e0e4a976   Renato De Donato   data-sevc-control...
353
354
355
356
357
358
359
  
  //                var inputs = document.getElementsByTagName("paper-dropdown-menu");
  //                console.log(inputs);
  //                for(var i in inputs)
  //                    console.log(i);
  //                for(var i=0; i < inputs.length; i++)
  //                    console.log($(inputs[i]).children("paper-menu"));
a31f0660   root   sevc-controllet i...
360
361
              },
  
0f6424fe   root   update new data-s...
362
363
364
365
              setFields : function(fields) {
                  this.fields = fields;
              },
  
e0e4a976   Renato De Donato   data-sevc-control...
366
367
368
369
370
371
372
373
              reset : function() {
                  this.selectedDatalet = undefined;
                  this.inputs = [];
                  this.labels = [];
                  this.$.datalet_selection_datalet_placeholder.innerHTML = "";
              },
  
              _selectDatalet : function(e){
0f6424fe   root   update new data-s...
374
375
                  this.$.add_button.setAttribute("disabled", "true");
  
a31f0660   root   sevc-controllet i...
376
                  this.selectedDatalet = e.detail.datalet;
0f6424fe   root   update new data-s...
377
378
379
                  this.inputs = [];
                  this.labels = [];
  
a31f0660   root   sevc-controllet i...
380
381
382
383
                  if(this.selectedDatalet){
                      this.$.selectedDatalet_request.url = this.deepUrl + e.detail.datalet + "-datalet";
                      this.$.selectedDatalet_request.generateRequest();
                  }
0f6424fe   root   update new data-s...
384
385
386
387
388
  //                else {
  //                    this.inputs = [];
  //                    this.labels = [];
  //                }
  
e0e4a976   Renato De Donato   data-sevc-control...
389
390
391
  //                this.$.datalet_selection_datalet_placeholder.innerHTML = "";
  //                this.selectedFields = [];
              },
0f6424fe   root   update new data-s...
392
  
e0e4a976   Renato De Donato   data-sevc-control...
393
394
395
396
397
398
399
400
401
402
403
404
              _preselectDatalet : function() {
                  this.$.add_button.innerText = "MODIFY DATALET";
  
  
                  this.selectedDatalet = this.preselectedDatalet;
                  this.selectedFields = this._copy(this.fields);
  
                  var inputs = document.getElementsByTagName("paper-dropdown-menu");
                  for(var i=0; i < inputs.length; i++)
                      $(inputs[i]).find("paper-menu")[0].select(i);
  
                  this._loadDatalet(this.selectedFields);
a31f0660   root   sevc-controllet i...
405
406
              },
  
0f6424fe   root   update new data-s...
407
              _handleSelectedDatalet : function(e){
e0e4a976   Renato De Donato   data-sevc-control...
408
                  this.$.datalet_selection_datalet_placeholder.innerHTML = "";
0f6424fe   root   update new data-s...
409
  
a31f0660   root   sevc-controllet i...
410
411
412
413
414
                  var inputs = e.detail.response.idm.inputs.input;
                  var labels = e.detail.response.idm.inputs.layouts.input;
  
                  if(inputs.constructor == Object) {//not Array && inputs.input.selection == "*"
                      var name = inputs.name;
0f6424fe   root   update new data-s...
415
416
                      var description = inputs.description;
                      var selection = inputs.selection;
a31f0660   root   sevc-controllet i...
417
418
                      inputs = [];
                      for(var i in this.fields)
0f6424fe   root   update new data-s...
419
                          inputs.push({name: name + " " + i, description: description, selection: selection});
a31f0660   root   sevc-controllet i...
420
421
422
423
                  }
  
                  this.inputs = inputs;
                  this.labels = labels;
a31f0660   root   sevc-controllet i...
424
  
e0e4a976   Renato De Donato   data-sevc-control...
425
426
427
428
  //                if(this.inputs[0].selection == "*")
  //                    this.selectedFields = [];
  //                else
                      this.selectedFields = new Array(inputs.length);
0f6424fe   root   update new data-s...
429
430
              },
  
e0e4a976   Renato De Donato   data-sevc-control...
431
              _addInput : function(e){
9579b866   Renato De Donato   firefox bug fix
432
433
434
435
436
                  console.log(e.target.innerHTML.trim());
                  console.log(e.target.innerText);
                  console.log(e.currentTarget.innerHTML.trim());
                  console.log(e.currentTarget.innerText);
  
0f6424fe   root   update new data-s...
437
                  var selectedFields = this._copy(this.selectedFields);
0f6424fe   root   update new data-s...
438
  
e0e4a976   Renato De Donato   data-sevc-control...
439
                  var index = $(e.target).parents("paper-dropdown-menu")[0].id;
9579b866   Renato De Donato   firefox bug fix
440
                  selectedFields[index] = e.target.innerHTML.trim();
0f6424fe   root   update new data-s...
441
  
e0e4a976   Renato De Donato   data-sevc-control...
442
                  this.selectedFields = this._copy(selectedFields);
0f6424fe   root   update new data-s...
443
  
e0e4a976   Renato De Donato   data-sevc-control...
444
                  var load = true;
0f6424fe   root   update new data-s...
445
  
e0e4a976   Renato De Donato   data-sevc-control...
446
447
448
449
450
451
452
453
454
455
456
457
458
459
                  if(this.inputs[0].selection == "*"){
                      var temp = [];
                      for (var i = 0; i < selectedFields.length; i++)
                          if(selectedFields[i])
                             temp.push(selectedFields[i]);
                      selectedFields = temp;
                  }
                  else {
                      for (var i = 0; i < selectedFields.length; i++)
                          if (!selectedFields[i]) {
                              load = false;
                              break;
                          }
                  }
0f6424fe   root   update new data-s...
460
461
  
                  if(load){
57ef9bf4   Renato De Donato   labels + info
462
463
464
465
466
467
468
469
                      var labels = this.$.datalet_selection_labels.querySelectorAll("paper-textarea");
                      console.log(labels);
                      for (var i = 0; i < labels.length; i++) {
                          if (labels[i].innerHTML.trim() != "") {
                              this.params[labels[i].label] = labels[i].value;
                          }
                      }
  
e0e4a976   Renato De Donato   data-sevc-control...
470
471
                      this._loadDatalet(selectedFields);
                  }
0f6424fe   root   update new data-s...
472
  
e0e4a976   Renato De Donato   data-sevc-control...
473
474
475
476
477
478
  //                $("#base_datalet_container").html("");
  //                $("#base_datalet_container").css('visibility','hidden');
  //                $("#base_datalet_container").css('padding','0px');
  //                $("#base_datalet_container").css('height','0px');
  //                console.log($("#base_datalet_container"));
              },
0f6424fe   root   update new data-s...
479
  
e0e4a976   Renato De Donato   data-sevc-control...
480
              _loadDatalet : function(selectedFields){
57ef9bf4   Renato De Donato   labels + info
481
  //                var params = {'data-url' : this.dataUrl};
0f6424fe   root   update new data-s...
482
  
e0e4a976   Renato De Donato   data-sevc-control...
483
484
                  var dataletParams ={
                      component   : this.selectedDatalet+"-datalet",
57ef9bf4   Renato De Donato   labels + info
485
                      params      : this.params,
e0e4a976   Renato De Donato   data-sevc-control...
486
487
488
                      fields      : selectedFields,
                      placeHolder : this.$.datalet_selection_datalet_placeholder
                  };
0f6424fe   root   update new data-s...
489
  
e0e4a976   Renato De Donato   data-sevc-control...
490
491
                  ComponentService.deep_url = this.deepUrl;
                  ComponentService.getComponent(dataletParams);
a31f0660   root   sevc-controllet i...
492
  
e0e4a976   Renato De Donato   data-sevc-control...
493
                  this.async(function(){this.$.add_button.removeAttribute("disabled");}, 1111);
0f6424fe   root   update new data-s...
494
495
              },
  
e0e4a976   Renato De Donato   data-sevc-control...
496
              _addDatalet : function(){
0f6424fe   root   update new data-s...
497
  
9579b866   Renato De Donato   firefox bug fix
498
499
500
501
502
                  var selectedFields = [];
                  for (var i = 0; i < this.selectedFields.length; i++)
                      if(this.selectedFields[i])
                          selectedFields.push(this.selectedFields[i]);
  
0f6424fe   root   update new data-s...
503
504
                  var data = {
                      dataUrl : this.dataUrl,
57ef9bf4   Renato De Donato   labels + info
505
506
                      params :  this.params,
  //                    params :  {'data-url' : this.dataUrl},
9579b866   Renato De Donato   firefox bug fix
507
                      fields :  selectedFields,
0f6424fe   root   update new data-s...
508
509
510
511
512
513
                      datalet : this.selectedDatalet+"-datalet",
                      comment : this.$.comment.value,
                      staticData : JSON.stringify(this.$.datalet_selection_datalet_placeholder.children[1].behavior.data)
                  }
  
                  this.fire('data-sevc-controllet.dataletCreated', {data : data});
a31f0660   root   sevc-controllet i...
514
515
516
  
              },
  
57ef9bf4   Renato De Donato   labels + info
517
518
519
520
521
522
523
524
525
526
527
528
529
              _showInfo : function(e){
                  var t = e.target;
                  if(t.tagName.indexOf("IRON-ICON") != -1)
                      t = $(e.target).parents("paper-icon-button")[0];
  
                  var name = t.getAttribute("title").replace(" info", "");
  
                  var dataset = $.grep(this.inputs, function(e){ return e.name == name; })[0];
                  if(!dataset)
                      dataset = $.grep(this.labels, function(e){ return e.name == name; })[0];
  
                  this.$.dialog_name.innerHTML = dataset.name;
                  this.$.dialog_description.innerHTML = dataset.description;
79ec939f   Renato De Donato   info position + a...
530
                  this.$.dialog_info_input.open();
57ef9bf4   Renato De Donato   labels + info
531
532
  
                  var pos = t.getBoundingClientRect();
79ec939f   Renato De Donato   info position + a...
533
534
                  $("#dialog_info_input").css("top", pos.top - 4);
                  $("#dialog_info_input").css("left", pos.left - 4);
57ef9bf4   Renato De Donato   labels + info
535
536
              },
  
e0e4a976   Renato De Donato   data-sevc-control...
537
538
539
540
541
542
543
544
545
546
              _copy : function(o) {
                  var out, v, key;
                  out = Array.isArray(o) ? new Array(o.length) : {};
                  for (key in o) {
                      v = o[key];
                      out[key] = (typeof v === "object") ? this._copy(v) : v;
                  }
                  return out;
              },
  
a31f0660   root   sevc-controllet i...
547
548
549
550
551
552
553
554
              _resize : function(){
                  var h = Math.max(document.documentElement.clientHeight, window.innerHeight || 0) - 16;
                  h = h - 64 - 8; //height with page scroller
  
                  $("#items_vslider_container").height(h);//vslider controllet
  
                  $("#datalet_selection_inputs").height(h);
                  $("#datalet_selection_labels").height(h);
e0e4a976   Renato De Donato   data-sevc-control...
555
556
557
558
                  if(this.modify)
                      $("#datalet_selection_datalet").height(h-128);
                  else
                      $("#datalet_selection_datalet").height(h);
a31f0660   root   sevc-controllet i...
559
560
561
562
563
564
565
              }
  
          });
  
      </script>
  
  </dom-module>