FIX: while header drop down is dropped, header is in front

This commit is contained in:
Sam 2014-09-22 12:38:38 +10:00
parent fd5dde4ab5
commit 7ae72dc2ff

View File

@ -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);