You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by xi...@apache.org on 2014/09/03 20:21:57 UTC

[2/2] git commit: AMBARI-7122. Configs: when there is only one version, dropdown list is empty.(XIWANG)

AMBARI-7122. Configs: when there is only one version, dropdown list is empty.(XIWANG)


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

Branch: refs/heads/trunk
Commit: 03684175c8f75944de50c6975c6e89596e009c30
Parents: 7c3ea59
Author: Xi Wang <xi...@apache.org>
Authored: Tue Sep 2 15:18:32 2014 -0700
Committer: Xi Wang <xi...@apache.org>
Committed: Wed Sep 3 11:21:16 2014 -0700

----------------------------------------------------------------------
 ambari-web/app/styles/application.less          | 23 ++++++++++++++++----
 .../common/configs/config_history_flow.hbs      |  4 ++--
 .../views/common/configs/config_history_flow.js |  3 ++-
 3 files changed, 23 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/03684175/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 3a63981..5d384ec 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -5120,16 +5120,31 @@ ul.inline li {
       font-size: 13px;
       li {
         line-height: 30px;
+        .icon-caret-right {
+          font-size: 18px;
+          margin-right: 20px;
+        }
       }
       li:hover {
         background-color: #666666;
         background-image: linear-gradient(to bottom, #666666, #555555);
-        color: white;
+        color: #ffffff;
       }
-      .icon-caret-right {
-        font-size: 18px;
-        margin-right: 20px;
+      li.not-allowed {
+        // the version which is displayed
+        cursor: not-allowed;
+        color: #808080;
+        .icon-caret-right,
+        .dropdown-menu {
+          display: none;
+        }
       }
+      li.not-allowed:hover {
+        background-color: #ffffff;
+        background-image: none;
+        color: #808080;
+      }
+
       div.row-fluid, a {
         padding-left: 10px;
       }

http://git-wip-us.apache.org/repos/asf/ambari/blob/03684175/ambari-web/app/templates/common/configs/config_history_flow.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/config_history_flow.hbs b/ambari-web/app/templates/common/configs/config_history_flow.hbs
index 014950c..fe8f1eb 100644
--- a/ambari-web/app/templates/common/configs/config_history_flow.hbs
+++ b/ambari-web/app/templates/common/configs/config_history_flow.hbs
@@ -88,8 +88,8 @@
                   </button>
                   <ul class="dropdown-menu">
                     {{#each serviceVersion in view.dropDownList}}
-                        <li class="pointer dropdown-submenu">
-                            <div class="row-fluid version-in-dropdown" {{action switchVersion serviceVersion target="view"}}>
+                        <li {{bindAttr class=":pointer :dropdown-submenu serviceVersion.isDisplayed:not-allowed"}}>
+                            <div class="row-fluid version-in-dropdown " {{action switchVersion serviceVersion target="view"}}>
                                 <div class="span2">{{serviceVersion.versionText}}</div>
                                 <div class="span6">{{serviceVersion.modifiedDate}}</div>
                                 <div class="span3">{{serviceVersion.author}}</div>

http://git-wip-us.apache.org/repos/asf/ambari/blob/03684175/ambari-web/app/views/common/configs/config_history_flow.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/configs/config_history_flow.js b/ambari-web/app/views/common/configs/config_history_flow.js
index 5813eeb..d7d8d3f 100644
--- a/ambari-web/app/views/common/configs/config_history_flow.js
+++ b/ambari-web/app/views/common/configs/config_history_flow.js
@@ -126,7 +126,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
    * by default 6 is number of items in short list
    */
   dropDownList: function () {
-    var serviceVersions = this.get('serviceVersions').without(this.get('displayedServiceVersion')).slice(0).reverse();
+    var serviceVersions = this.get('serviceVersions').slice(0).reverse();
     if (this.get('showFullList')) {
       return serviceVersions;
     }
@@ -282,6 +282,7 @@ App.ConfigHistoryFlowView = Em.View.extend({
    * switch configs view version to chosen
    */
   switchVersion: function (event) {
+    if (event.context.get("isDisplayed"))  return;
     var version = event.context.get('version');
     var versionIndex = 0;