Repository: ambari Updated Branches: refs/heads/branch-2.1 7e3a02809 -> 159b90e56
AMBARI-13374. Issue with overlay for config groups popup on the ASW (onechiporenko) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/159b90e5 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/159b90e5 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/159b90e5 Branch: refs/heads/branch-2.1 Commit: 159b90e56a789be7e1ffa3d5ae184a4a3a95f148 Parents: 7e3a028 Author: Oleg Nechiporenko <onechipore...@apache.org> Authored: Fri Oct 9 16:44:07 2015 +0300 Committer: Oleg Nechiporenko <onechipore...@apache.org> Committed: Fri Oct 9 16:44:07 2015 +0300 ---------------------------------------------------------------------- .../alerts/alert_definitions_actions_controller.js | 4 +++- .../main/service/manage_config_groups_controller.js | 4 +++- ambari-web/app/views/common/modal_popup.js | 16 +++++++++++----- 3 files changed, 17 insertions(+), 7 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/159b90e5/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js b/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js index 96df2ac..e9bade3 100644 --- a/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js +++ b/ambari-web/app/controllers/main/alerts/alert_definitions_actions_controller.js @@ -176,7 +176,9 @@ App.MainAlertDefinitionActionsController = Em.ArrayController.extend({ this.set('disablePrimary', !modified); }.observes('subViewController.isDefsModified'), - didInsertElement: Em.K + didInsertElement: function () { + this.fitZIndex(); + } }); }, http://git-wip-us.apache.org/repos/asf/ambari/blob/159b90e5/ambari-web/app/controllers/main/service/manage_config_groups_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/main/service/manage_config_groups_controller.js b/ambari-web/app/controllers/main/service/manage_config_groups_controller.js index 4328a7a..7b337c3 100644 --- a/ambari-web/app/controllers/main/service/manage_config_groups_controller.js +++ b/ambari-web/app/controllers/main/service/manage_config_groups_controller.js @@ -892,7 +892,9 @@ App.ManageConfigGroupsController = Em.Controller.extend(App.ConfigOverridable, { this.set('disablePrimary', !modified); }.observes('subViewController.isHostsModified'), - didInsertElement: Em.K + didInsertElement: function () { + this.fitZIndex(); + } }); } http://git-wip-us.apache.org/repos/asf/ambari/blob/159b90e5/ambari-web/app/views/common/modal_popup.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/common/modal_popup.js b/ambari-web/app/views/common/modal_popup.js index b07fc22..c6b8438 100644 --- a/ambari-web/app/views/common/modal_popup.js +++ b/ambari-web/app/views/common/modal_popup.js @@ -70,21 +70,27 @@ App.ModalPopup = Ember.View.extend({ block.css('max-height', $(window).height() - block.offset().top - this.marginBottom + $(window).scrollTop()); // fix popup height } } - // If popup is opened from another popup it should be displayed above + this.fitZIndex(); + var firstInputElement = this.$('#modal').find(':input').not(':disabled').first(); + this.focusElement(firstInputElement); + }, + + /** + * If popup is opened from another popup it should be displayed above + * @method fitZIndex + */ + fitZIndex: function () { var existedPopups = $('.modal-backdrop'); if (existedPopups) { var maxZindex = 1; existedPopups.each(function(index, popup) { if ($(popup).css('z-index') > maxZindex) { maxZindex = $(popup).css('z-index'); - } + } }); this.$().find('.modal-backdrop').css('z-index', maxZindex * 2); this.$().find('.modal').css('z-index', maxZindex * 2 + 1); } - - var firstInputElement = this.$('#modal').find(':input').not(':disabled').first(); - this.focusElement(firstInputElement); }, focusElement: function(elem) {