You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2016/01/08 19:16:04 UTC

[47/50] [abbrv] ambari git commit: AMBARI-14589. [UI] Kerberos-> Configs -> description tooltip is not appearing for checkboxes (onechiporenko)

AMBARI-14589. [UI] Kerberos-> Configs -> description tooltip is not appearing for checkboxes (onechiporenko)


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

Branch: refs/heads/branch-dev-patch-upgrade
Commit: 9a3e1768721f904fdd0121097b6fc53eedc6a785
Parents: c3df8e9
Author: Oleg Nechiporenko <on...@apache.org>
Authored: Fri Jan 8 13:53:00 2016 +0200
Committer: Oleg Nechiporenko <on...@apache.org>
Committed: Fri Jan 8 14:13:10 2016 +0200

----------------------------------------------------------------------
 .../common/configs/service_config_category.hbs  |  2 +-
 ambari-web/app/views/common/controls_view.js    | 45 +++++++++++++++-----
 2 files changed, 35 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/9a3e1768/ambari-web/app/templates/common/configs/service_config_category.hbs
----------------------------------------------------------------------
diff --git a/ambari-web/app/templates/common/configs/service_config_category.hbs b/ambari-web/app/templates/common/configs/service_config_category.hbs
index 90f78d2..e72606c 100644
--- a/ambari-web/app/templates/common/configs/service_config_category.hbs
+++ b/ambari-web/app/templates/common/configs/service_config_category.hbs
@@ -55,7 +55,7 @@
                   <span {{bindAttr class="isEditable::muted"}}>{{formatWordBreak displayName}}</span>
                 {{/if}}
                 {{#if hintMessage}}
-                  <a class="icon-question-sign icon-blue" href="#" data-toggle="tooltip" {{bindAttr data-original-title="hintMessage"}}><a/>
+                  <a class="icon-question-sign icon-blue" href="#" data-toggle="tooltip" {{bindAttr data-original-title="hintMessage"}}></a>
                 {{/if}}
                 {{#if this.isComparison}}
                   {{#if controller.selectedConfigGroup.isDefault}}

http://git-wip-us.apache.org/repos/asf/ambari/blob/9a3e1768/ambari-web/app/views/common/controls_view.js
----------------------------------------------------------------------
diff --git a/ambari-web/app/views/common/controls_view.js b/ambari-web/app/views/common/controls_view.js
index 5b12163d..1bd789e 100644
--- a/ambari-web/app/views/common/controls_view.js
+++ b/ambari-web/app/views/common/controls_view.js
@@ -50,18 +50,34 @@ App.ServiceConfigPopoverSupport = Ember.Mixin.create({
     });
     // if description for this serviceConfig not exist, then no need to show popover
     if (this.get('isPopoverEnabled') !== 'false' && this.get('serviceConfig.description')) {
-      App.popover(this.$(), {
-        title: Em.I18n.t('installer.controls.serviceConfigPopover.title').format(
-          this.get('serviceConfig.displayName'),
-          (this.get('serviceConfig.displayName') == this.get('serviceConfig.name')) ? '' : this.get('serviceConfig.name')
-        ),
-        content: this.get('serviceConfig.description'),
-        placement: this.get('popoverPlacement'),
-        trigger: 'hover'
-      });
+      this.addPopover();
     }
   },
 
+  /**
+   * Element where popover is "appended"
+   */
+  elementForPopover: function () {
+    return this.$();
+  }.property(),
+
+  /**
+   * Add Popover for config-boxes
+   *
+   * @method addPopover
+   */
+  addPopover: function () {
+    App.popover(this.get('elementForPopover'), {
+      title: Em.I18n.t('installer.controls.serviceConfigPopover.title').format(
+        this.get('serviceConfig.displayName'),
+        (this.get('serviceConfig.displayName') === this.get('serviceConfig.name')) ? '' : this.get('serviceConfig.name')
+      ),
+      content: this.get('serviceConfig.description'),
+      placement: this.get('popoverPlacement'),
+      trigger: 'hover'
+    });
+  },
+
   willDestroyElement: function() {
     this.$().popover('destroy');
   },
@@ -317,10 +333,14 @@ App.ServiceConfigCheckbox = Ember.Checkbox.extend(App.ServiceConfigPopoverSuppor
 
   checked: false,
 
+  elementForPopover: function () {
+    return this.$().parent('.control-group').find('.bootstrap-checkbox');
+  }.property(),
+
   /**
    * set appropriate config values pair
    * to define which value is positive (checked) property
-   * and what value is negative (unchecked) proeprty
+   * and what value is negative (unchecked) property
    */
   didInsertElement: function() {
     var self = this;
@@ -335,13 +355,16 @@ App.ServiceConfigCheckbox = Ember.Checkbox.extend(App.ServiceConfigPopoverSuppor
     this.set('checked', this.get('serviceConfig.value') === this.get('trueValue'));
     this.propertyDidChange('checked');
     Em.run.next(function () {
-      if (self.$())
+      if (self.$()) {
         self.$().checkbox({
           defaultState: self.get('serviceConfig.value'),
           buttonStyle: 'btn-link btn-large',
           checkedClass: 'icon-check',
           uncheckedClass: 'icon-check-empty'
         });
+        self.propertyDidChange('elementForPopover');
+        self.addPopover();
+      }
     });
   },