From f974e82498c904188b0f3fc3f15be1987f4718a1 Mon Sep 17 00:00:00 2001
From: luigser <luigser@gmail.com>
Date: Fri, 25 Sep 2015 17:36:36 +0200
Subject: [PATCH] Bugs fix

---
 controllets/data-sevc-controllet/data-sevc-controllet.html                 |  2 +-
 controllets/draggable-element-controllet/draggable-element-controllet.html |  7 ++++++-
 datalets/treemap-datalet/treemap-datalet.html                              | 19 ++++++-------------
 3 files changed, 13 insertions(+), 15 deletions(-)

diff --git a/controllets/data-sevc-controllet/data-sevc-controllet.html b/controllets/data-sevc-controllet/data-sevc-controllet.html
index 1a41687..b598260 100755
--- a/controllets/data-sevc-controllet/data-sevc-controllet.html
+++ b/controllets/data-sevc-controllet/data-sevc-controllet.html
@@ -325,7 +325,7 @@
 
                     <div class="fancy area_container">
                         <paper-tabs selected="{{DatasourceTabSelected}}">
-                            <paper-tab>Select data suorce</paper-tab>
+                            <paper-tab>Select data source</paper-tab>
                             <paper-tab>Most popular</paper-tab>
                             <paper-tab>Search</paper-tab>
                         </paper-tabs>
diff --git a/controllets/draggable-element-controllet/draggable-element-controllet.html b/controllets/draggable-element-controllet/draggable-element-controllet.html
index fd25935..58f0392 100755
--- a/controllets/draggable-element-controllet/draggable-element-controllet.html
+++ b/controllets/draggable-element-controllet/draggable-element-controllet.html
@@ -116,7 +116,7 @@
         </template>
 
         <template is="dom-if" if="{{!isTarget}}">
-            <div class="drag-content-source" draggable="true" on-track="_handleTrack" on-drag="_handleStartDrag">
+            <div class="drag-content-source" draggable="true" on-track="_handleTrack" on-drag="_handleOnDrag" on-dragstart="_handleStartDrag">
                 <div id="{{identifier}}" class='draggable-card unselectable'>{{label}}</div>
             </div>
         </template>
@@ -171,6 +171,11 @@
             },
 
             _handleStartDrag : function(e){
+                /*var target = EventUtil.getCurrentTarget(e);
+                target.style.cursor = 'move';*/
+            },
+
+            _handleOnDrag : function(e){
                 this.targets = document.querySelectorAll('draggable-element-controllet[is-target=true]');
                 for (var i = 0; i < this.targets.length; i++) {
                     this.targets[i].children[0].children[1].className = "onTrackOnTarget dd-content-target unselectable style-scope draggable-element-controllet";
diff --git a/datalets/treemap-datalet/treemap-datalet.html b/datalets/treemap-datalet/treemap-datalet.html
index 465ec6e..668209d 100755
--- a/datalets/treemap-datalet/treemap-datalet.html
+++ b/datalets/treemap-datalet/treemap-datalet.html
@@ -12,6 +12,7 @@
             #treemap_placeholder {
                 width: 100%;
                 height: 70%;
+                min-height: 500px;
                 background: #ddd;
             }
 
@@ -56,7 +57,7 @@
             }
         </style>
         <div id="treemap_placeholder"></div>
-        <base-datalet data-url="{{dataUrl}}" query="{{query}}" fields-order="{{fieldsOrder}}"></base-datalet>
+        <base-datalet data-url="{{dataUrl}}" query="{{query}}"></base-datalet>
     </template>
 
     <script src="../shared_js/d3.js"></script>
@@ -88,16 +89,8 @@
 
                 this.map.children = [];
 
-                //var curr_fields_order = this._component.fieldsOrder.split(',');
-                //var curr_fields_order = new Array();
-                var curr_fields_order = "0,1,2".split(',');
-                for(var i = 0; i < queries.length; i++) curr_fields_order.push(i);
-
-                var value_index = curr_fields_order[curr_fields_order.length -1];
-                curr_fields_order.pop();
-
                 for(var i = 0; i < this.properties.data.value.length; i++){
-                    this.checkAggragationField(this.properties.data.value[i], curr_fields_order , value_index);
+                    this.checkAggragationField(this.properties.data.value[i], queries.length - 1 , queries.length - 1);
                 }
                 //var json = JSON.stringify(this.map);
             },
@@ -111,12 +104,12 @@
                 children.push(nchild);
                 return nchild;
             },
-            checkAggragationField: function(object, cat_index, value_index){
+            checkAggragationField: function(object, levels, value_index){
                 var curchild = this.map;
                 var keys = Object.keys(object);
-                for(var level= 0; level < cat_index.length; level++){
+                for(var level= 0; level < levels; level++){
 
-                    var child = this.findChild(curchild, object[keys[cat_index[level]]]);
+                    var child = this.findChild(curchild, object[keys[level]]);
                     curchild = child;
                 }
 
--
libgit2 0.21.4