ignite-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akuznet...@apache.org
Subject ignite git commit: IGNITE-1859 Added tooltips for long strings and fixed summary page drop down POJO width.
Date Thu, 12 Nov 2015 03:23:20 GMT
Repository: ignite
Updated Branches:
  refs/heads/ignite-843-rc1 124c78855 -> 15f9b2d24


IGNITE-1859 Added tooltips for long strings and fixed summary page drop down  POJO width.


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/15f9b2d2
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/15f9b2d2
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/15f9b2d2

Branch: refs/heads/ignite-843-rc1
Commit: 15f9b2d24ed5c4f2969d079f6ebfc286daa78b43
Parents: 124c788
Author: vsisko@gridgain.com <kope@kope-mac.local>
Authored: Thu Nov 12 10:23:20 2015 +0700
Committer: Alexey Kuznetsov <akuznetsov@apache.org>
Committed: Thu Nov 12 10:23:20 2015 +0700

----------------------------------------------------------------------
 .../main/js/controllers/caches-controller.js    |  1 +
 .../main/js/controllers/clusters-controller.js  |  1 +
 .../src/main/js/controllers/common-module.js    | 51 ++++++++++++++------
 .../src/main/js/controllers/igfs-controller.js  |  1 +
 .../main/js/controllers/metadata-controller.js  |  1 +
 .../main/js/controllers/summary-controller.js   |  1 +
 .../src/main/js/public/stylesheets/style.scss   |  5 ++
 .../main/js/views/configuration/summary.jade    |  4 +-
 .../src/main/js/views/templates/select.jade     |  2 +-
 9 files changed, 49 insertions(+), 18 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/15f9b2d2/modules/control-center-web/src/main/js/controllers/caches-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/caches-controller.js b/modules/control-center-web/src/main/js/controllers/caches-controller.js
index 41584b8..3be08e1 100644
--- a/modules/control-center-web/src/main/js/controllers/caches-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/caches-controller.js
@@ -32,6 +32,7 @@ consoleModule.controller('cachesController', [
             $scope.getModel = $common.getModel;
             $scope.javaBuildInClasses = $common.javaBuildInClasses;
             $scope.compactJavaName = $common.compactJavaName;
+            $scope.widthIsSufficient = $common.widthIsSufficient;
             $scope.saveBtnTipText = $common.saveBtnTipText;
             $scope.panelExpanded = $common.panelExpanded;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/15f9b2d2/modules/control-center-web/src/main/js/controllers/clusters-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/clusters-controller.js b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
index fed00c9..e3bd651 100644
--- a/modules/control-center-web/src/main/js/controllers/clusters-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/clusters-controller.js
@@ -31,6 +31,7 @@ consoleModule.controller('clustersController', [
         $scope.joinTip = $common.joinTip;
         $scope.getModel = $common.getModel;
         $scope.compactJavaName = $common.compactJavaName;
+        $scope.widthIsSufficient = $common.widthIsSufficient;
         $scope.saveBtnTipText = $common.saveBtnTipText;
         $scope.panelExpanded = $common.panelExpanded;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/15f9b2d2/modules/control-center-web/src/main/js/controllers/common-module.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/common-module.js b/modules/control-center-web/src/main/js/controllers/common-module.js
index 5e34adf..5106132 100644
--- a/modules/control-center-web/src/main/js/controllers/common-module.js
+++ b/modules/control-center-web/src/main/js/controllers/common-module.js
@@ -454,29 +454,38 @@ consoleModule.service('$common', [
          * @returns {*[]} First element is length of class for single value, second element
is length for pair vlaue.
          */
         function availableWidth(index, id) {
-            var divs = $($('#' + id).find('tr')[index - 1]).find('div');
-
-            var div = null;
+            var idElem = $('#' + id);
 
             var width = 0;
 
-            for (var divIx = 0; divIx < divs.length; divIx ++)
-                if (divs[divIx].className.length == 0 && (div == null ||  divs[divIx].childNodes.length
> div.childNodes.length))
-                    div = divs[divIx];
+            switch (idElem.prop("tagName")) {
+                // Detection of available width in presentation table row.
+                case 'TABLE':
+                    var cont = $(idElem.find('tr')[index - 1]).find('td')[0];
+
+                    width = cont.clientWidth;
+
+                    if (width > 0) {
+                        var children = $(cont).children(':not("a")');
 
-            if (div != null) {
-                width = div.clientWidth;
+                        _.forEach(children, function(child) {
+                            if ('offsetWidth' in child)
+                                width -= $(child).outerWidth(true);
+                        });
+                    }
 
-                if (width > 0) {
-                    var children = div.childNodes;
+                    break;
 
-                    for (var i = 1; i < children.length; i++) {
-                        var child = children[i];
+                // Detection of available width in dropdown row.
+                case 'A':
+                    width = idElem.width();
 
+                    $(idElem).children(':not("span")').each(function(ix, child) {
                         if ('offsetWidth' in child)
-                            width -= $(children[i]).outerWidth(true);
-                    }
-                }
+                            width -= child.offsetWidth;
+                    });
+
+                    break;
             }
 
             return width | 0;
@@ -736,6 +745,18 @@ consoleModule.service('$common', [
 
                 return result;
             },
+            widthIsSufficient: function(id, index, text) {
+                try {
+                    var available = availableWidth(index, id);
+
+                    var required = measureText(text);
+
+                    return !available || available >= Math.floor(required);
+                }
+                catch (err) {
+                    return true;
+                }
+            },
             ensureActivePanel: function (panels, id, focusId) {
                 ensureActivePanel(panels, id, focusId);
             },

http://git-wip-us.apache.org/repos/asf/ignite/blob/15f9b2d2/modules/control-center-web/src/main/js/controllers/igfs-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/igfs-controller.js b/modules/control-center-web/src/main/js/controllers/igfs-controller.js
index 8914a71..5743180 100644
--- a/modules/control-center-web/src/main/js/controllers/igfs-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/igfs-controller.js
@@ -32,6 +32,7 @@ consoleModule.controller('igfsController', [
             $scope.getModel = $common.getModel;
             $scope.javaBuildInClasses = $common.javaBuildInClasses;
             $scope.compactJavaName = $common.compactJavaName;
+            $scope.widthIsSufficient = $common.widthIsSufficient;
             $scope.saveBtnTipText = $common.saveBtnTipText;
             $scope.panelExpanded = $common.panelExpanded;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/15f9b2d2/modules/control-center-web/src/main/js/controllers/metadata-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/metadata-controller.js b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
index 64cc718..43516f1 100644
--- a/modules/control-center-web/src/main/js/controllers/metadata-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/metadata-controller.js
@@ -42,6 +42,7 @@ consoleModule.controller('metadataController', [
             $scope.getModel = $common.getModel;
             $scope.javaBuildInClasses = $common.javaBuildInClasses;
             $scope.compactJavaName = $common.compactJavaName;
+            $scope.widthIsSufficient = $common.widthIsSufficient;
             $scope.saveBtnTipText = $common.saveBtnTipText;
             $scope.panelExpanded = $common.panelExpanded;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/15f9b2d2/modules/control-center-web/src/main/js/controllers/summary-controller.js
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/controllers/summary-controller.js b/modules/control-center-web/src/main/js/controllers/summary-controller.js
index 2ade9e1..ca0eab6 100644
--- a/modules/control-center-web/src/main/js/controllers/summary-controller.js
+++ b/modules/control-center-web/src/main/js/controllers/summary-controller.js
@@ -23,6 +23,7 @@ consoleModule.controller('summaryController', [
     $scope.tableVisibleRow = $table.tableVisibleRow;
     $scope.joinTip = $common.joinTip;
     $scope.getModel = $common.getModel;
+    $scope.widthIsSufficient = $common.widthIsSufficient;
 
     $scope.showMoreInfo = $message.message;
 

http://git-wip-us.apache.org/repos/asf/ignite/blob/15f9b2d2/modules/control-center-web/src/main/js/public/stylesheets/style.scss
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/public/stylesheets/style.scss b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
index 9ab0c12..8cba70f 100644
--- a/modules/control-center-web/src/main/js/public/stylesheets/style.scss
+++ b/modules/control-center-web/src/main/js/public/stylesheets/style.scss
@@ -144,6 +144,11 @@ ul.navbar-nav, .sidebar-nav {
     color: $input-color-placeholder;
 }
 
+.theme-line .summary-pojo-list > ul.dropdown-menu {
+    width: 100%;
+    max-width: none;
+}
+
 .theme-line ul.dropdown-menu {
     min-width: 120px;
     max-width: 280px;

http://git-wip-us.apache.org/repos/asf/ignite/blob/15f9b2d2/modules/control-center-web/src/main/js/views/configuration/summary.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/configuration/summary.jade b/modules/control-center-web/src/main/js/views/configuration/summary.jade
index 6b3b9a1..562ca44 100644
--- a/modules/control-center-web/src/main/js/views/configuration/summary.jade
+++ b/modules/control-center-web/src/main/js/views/configuration/summary.jade
@@ -39,8 +39,8 @@ mixin pojos(side)
         .details-row
             .col-xs-2.col-sm-2.col-md-2
                 label POJO class:
-            .col-xs-10.col-sm-10.col-md-10
-                button.select-toggle.form-control(ng-model='config#{side}.pojoClass' bs-select
bs-options='item for item in pojoClasses()')
+            .col-xs-10.col-sm-10.col-md-10.summary-pojo-list
+                button.select-toggle.form-control(ng-model='config#{side}.pojoClass' bs-select
bs-options='item for item in pojoClasses()' data-container='')
             .col-xs-2.col-sm-2.col-md-2
                 label
             .col-xs-10.col-sm-10.col-md-10

http://git-wip-us.apache.org/repos/asf/ignite/blob/15f9b2d2/modules/control-center-web/src/main/js/views/templates/select.jade
----------------------------------------------------------------------
diff --git a/modules/control-center-web/src/main/js/views/templates/select.jade b/modules/control-center-web/src/main/js/views/templates/select.jade
index 3ff8d21..5825d1e 100644
--- a/modules/control-center-web/src/main/js/views/templates/select.jade
+++ b/modules/control-center-web/src/main/js/views/templates/select.jade
@@ -21,6 +21,6 @@ ul.select.dropdown-menu(tabindex='-1' ng-show='$isVisible()' role='select')
         hr(style='margin: 5px 0')
     li(role='presentation' ng-repeat='match in $matches')
         hr(ng-if='match.value == undefined' style='margin: 5px 0')
-        a(id='li-dropdown-item-{{$index}}'  role='menuitem' tabindex='-1' ng-class='{active:
$isActive($index)}' ng-click='$select($index, $event)')
+        a(id='li-dropdown-item-{{$index}}'  role='menuitem' tabindex='-1' ng-class='{active:
$isActive($index)}' ng-click='$select($index, $event)' bs-tooltip='widthIsSufficient &&
!widthIsSufficient("li-dropdown-item-{{$index}}", $index, match.label) ? match.label : ""'
data-placement='bottom')
             i(class='{{$iconCheckmark}}' ng-if='$isActive($index)' ng-class='{active: $isActive($index)}')
             span(ng-bind='match.label')


Mime
View raw message