Commit 486a1c485a145f3a248585a4c07e27da98cbfb7e
1 parent
24be6abb
selection controllet with preset
Showing
1 changed file
with
30 additions
and
22 deletions
controllets/data-sevc-controllet/data-sevc-controllet.html
... | ... | @@ -262,7 +262,12 @@ Example: |
262 | 262 | |
263 | 263 | #idm_layout_main_container{ |
264 | 264 | position: relative; |
265 | - height: 65vh; | |
265 | + height: 50vh; | |
266 | + } | |
267 | + | |
268 | + #comment{ | |
269 | + position: relative; | |
270 | + width: 35vw; | |
266 | 271 | } |
267 | 272 | |
268 | 273 | paper-menu{ |
... | ... | @@ -345,7 +350,7 @@ Example: |
345 | 350 | <div><img src="static/images/or.png" style="position: relative;left: 50%;padding-top:20px"></div> |
346 | 351 | |
347 | 352 | <div class="card-content"> |
348 | - <paper-textarea id="data_url" label="Dataset api data url" floatingLabel value="{{dataUrl}}" on-dragover="_handleDatasourceDragOver"></paper-textarea> | |
353 | + <paper-textarea class="custom_textarea" id="data_url" label="Dataset api data url" floatingLabel value="{{dataUrl}}" on-dragover="_handleDatasourceDragOver"></paper-textarea> | |
349 | 354 | </div> |
350 | 355 | |
351 | 356 | |
... | ... | @@ -455,6 +460,11 @@ Example: |
455 | 460 | <div id="idm_layout_main_container" class="area_container"> |
456 | 461 | <div id="idm_layout_container" class="area_container"></div> |
457 | 462 | </div> |
463 | + | |
464 | + <div id="comment"> | |
465 | + <paper-textarea class="custom_textarea" id="commentArea" label="Max 100 character comment" maxlength="100"></paper-textarea> | |
466 | + </div> | |
467 | + | |
458 | 468 | </div> |
459 | 469 | |
460 | 470 | <div id="datalet_placeholder_2" style="min-width: 43%;margin-top: 10px;"></div> |
... | ... | @@ -663,9 +673,22 @@ Example: |
663 | 673 | |
664 | 674 | if(this.dataletPreset != undefined) { |
665 | 675 | this.$.data_url.value = this.dataletPreset['data-url']; |
666 | - this.selected = 3; | |
676 | + this.selected = 1; | |
667 | 677 | } |
668 | 678 | }, |
679 | + /** | |
680 | + * Utility function to inject datalet in a placeholder | |
681 | + */ | |
682 | + injectDatalet: function(place_holder){ | |
683 | + var datalet_params_2 ={ | |
684 | + component : this.selectedDatalet, | |
685 | + params : this.paramsFields, | |
686 | + fields : this.selectedFields, | |
687 | + placeHolder : place_holder | |
688 | + }; | |
689 | + ComponentService.deep_url = this.deepUrl; | |
690 | + ComponentService.getComponent(datalet_params_2); | |
691 | + }, | |
669 | 692 | |
670 | 693 | /** |
671 | 694 | * Callback to parse the data requested when dataUrl change its value |
... | ... | @@ -808,25 +831,7 @@ Example: |
808 | 831 | } |
809 | 832 | } |
810 | 833 | |
811 | - | |
812 | - var datalet_params ={ | |
813 | - component : this.selectedDatalet, | |
814 | - params : this.paramsFields, | |
815 | - fields : this.selectedFields, | |
816 | - placeHolder : this.$.datalet_placeholder | |
817 | - }; | |
818 | - | |
819 | - var datalet_params_2 ={ | |
820 | - component : this.selectedDatalet, | |
821 | - params : this.paramsFields, | |
822 | - fields : this.selectedFields, | |
823 | - placeHolder : this.$.datalet_placeholder_2 | |
824 | - }; | |
825 | - | |
826 | - | |
827 | - ComponentService.deep_url = this.deepUrl; | |
828 | - ComponentService.getComponent(datalet_params); | |
829 | - ComponentService.getComponent(datalet_params_2); | |
834 | + this.injectDatalet(this.$.datalet_placeholder); | |
830 | 835 | |
831 | 836 | }, |
832 | 837 | /** |
... | ... | @@ -859,6 +864,7 @@ Example: |
859 | 864 | return true; |
860 | 865 | } |
861 | 866 | case 3: |
867 | + this.injectDatalet(this.$.datalet_placeholder_2); | |
862 | 868 | return true; |
863 | 869 | } |
864 | 870 | |
... | ... | @@ -989,6 +995,7 @@ Example: |
989 | 995 | */ |
990 | 996 | _textElementChanged : function(e){ |
991 | 997 | this.generateDataletPreview(); |
998 | + this.injectDatalet(this.$.datalet_placeholder_2); | |
992 | 999 | }, |
993 | 1000 | /** |
994 | 1001 | * Callback related to the drag operation in the dataUrl input area. It's used to delete previous value. |
... | ... | @@ -1020,6 +1027,7 @@ Example: |
1020 | 1027 | params : this.paramsFields, |
1021 | 1028 | fields : this.selectedFields, |
1022 | 1029 | datalet : this.selectedDatalet, |
1030 | + comment : this.$.commentArea.value, | |
1023 | 1031 | staticData : JSON.stringify(this.$.datalet_placeholder.children[1].behavior.data) |
1024 | 1032 | } |
1025 | 1033 | ... | ... |