ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From onechipore...@apache.org
Subject git commit: AMBARI-5070. Labels of Advanced configuration properties wrap over in between words. (onechiporenko)
Date Thu, 13 Mar 2014 15:11:18 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e40bf7090 -> 0c3b372ae


AMBARI-5070. Labels of Advanced configuration properties wrap over in between words. (onechiporenko)


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

Branch: refs/heads/trunk
Commit: 0c3b372aecb96502229a4ab843b8c628f5f434c7
Parents: e40bf70
Author: Oleg Nechiporenko <onechiporenko@apache.org>
Authored: Thu Mar 13 17:08:13 2014 +0200
Committer: Oleg Nechiporenko <onechiporenko@apache.org>
Committed: Thu Mar 13 17:11:12 2014 +0200

----------------------------------------------------------------------
 ambari-web/app/styles/application.less          |  4 +++
 .../templates/common/configs/service_config.hbs |  2 +-
 ambari-web/app/utils/helper.js                  | 28 ++++++++++++++++++++
 3 files changed, 33 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/0c3b372a/ambari-web/app/styles/application.less
----------------------------------------------------------------------
diff --git a/ambari-web/app/styles/application.less b/ambari-web/app/styles/application.less
index 75fa393..1e6bc31 100644
--- a/ambari-web/app/styles/application.less
+++ b/ambari-web/app/styles/application.less
@@ -55,6 +55,10 @@ html, body {
   height: 100%;
 }
 
+wbr {
+  display: inline-block;
+}
+
 #wrapper {
   min-height: 100%;
 }

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c3b372a/ambari-web/app/templates/common/configs/service_config.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config.hbs b/ambari-web/app/templates/common/configs/service_config.hbs
index 1dcafbf..15c930a 100644
--- a/ambari-web/app/templates/common/configs/service_config.hbs
+++ b/ambari-web/app/templates/common/configs/service_config.hbs
@@ -99,7 +99,7 @@
                           {{#if showLabel}}
                             <span {{bindAttr class="errorMessage:error: :control-group
:control-label-span"}}>
                               <label class="control-label">
-                                {{displayName}}
+                                {{formatWordBreak displayName}}
                                 {{#if App.supports.secureCluster}}
                                   {{#if isSecureConfig}}
                                     <a href="javascript:void(null);"><i class="icon-lock"
rel="tooltip" data-toggle="tooltip" title="security knob"></i></a>

http://git-wip-us.apache.org/repos/asf/ambari/blob/0c3b372a/ambari-web/app/utils/helper.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/utils/helper.js b/ambari-web/app/utils/helper.js
index e08db89..1830c42 100644
--- a/ambari-web/app/utils/helper.js
+++ b/ambari-web/app/utils/helper.js
@@ -438,6 +438,34 @@ App.registerBoundHelper('formatNull', Em.View.extend({
 }));
 
 /**
+ * Return formatted string with inserted <code>wbr</code>-tag after each dot
+ *
+ * @param {String} content
+ *
+ * Examples:
+ *
+ * returns 'apple'
+ * {{formatWordBreak 'apple'}}
+ *
+ * returns 'apple.<wbr />banana'
+ * {{formatWordBreak 'apple.banana'}}
+ *
+ * returns 'apple.<wbr />banana.<wbr />uranium'
+ * {{formatWordBreak 'apple.banana.uranium'}}
+ */
+App.registerBoundHelper('formatWordBreak', Em.View.extend({
+  tagName: 'span',
+  template: Em.Handlebars.compile('{{{view.result}}}'),
+
+  /**
+   * @type {string}
+   */
+  result: function() {
+    return this.get('content').replace(/\./g, '.<wbr />');
+  }.property('content')
+}));
+
+/**
  * Ambari overrides the default date transformer.
  * This is done because of the non-standard data
  * sent. For example Nagios sends date as "12345678".


Mime
View raw message