From 7ae72dc2ff3ee7b10e27de7efd221b6b7ce32b2e Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 22 Sep 2014 12:38:38 +1000 Subject: [PATCH] FIX: while header drop down is dropped, header is in front --- .../javascripts/discourse/views/header.js.es6 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/app/assets/javascripts/discourse/views/header.js.es6 b/app/assets/javascripts/discourse/views/header.js.es6 index c6e7e3013b5..f2d1c6aca7c 100644 --- a/app/assets/javascripts/discourse/views/header.js.es6 +++ b/app/assets/javascripts/discourse/views/header.js.es6 @@ -6,6 +6,9 @@ @namespace Discourse @module Discourse **/ + +var originalZIndex; + export default Discourse.View.extend({ tagName: 'header', classNames: ['d-header', 'clearfix'], @@ -18,8 +21,17 @@ export default Discourse.View.extend({ $li = $target.closest('li'), $ul = $target.closest('ul'), $html = $('html'), + $header = $('header'), + replyZIndex = parseInt($('#reply-control').css('z-index'), 10), self = this; + + originalZIndex = originalZIndex || $('header').css('z-index'); + + if(replyZIndex > 0) { + $header.css("z-index", replyZIndex + 1); + } + var controller = self.get('controller'); if(controller && !controller.isDestroyed){ controller.set('visibleDropdown', elementId); @@ -38,6 +50,7 @@ export default Discourse.View.extend({ } var hideDropdown = function() { + $header.css("z-index", originalZIndex); $dropdown.fadeOut('fast'); $li.removeClass('active'); $html.data('hide-dropdown', null);