diff --git a/app/assets/javascripts/discourse/components/discourse-banner.js.es6 b/app/assets/javascripts/discourse/components/discourse-banner.js.es6 index f4a23f6404d..421510f072e 100644 --- a/app/assets/javascripts/discourse/components/discourse-banner.js.es6 +++ b/app/assets/javascripts/discourse/components/discourse-banner.js.es6 @@ -1,4 +1,4 @@ -import VisibleComponent from "discourse/components/visible-component"; +import VisibleComponent from "discourse/components/visible"; export default VisibleComponent.extend({ diff --git a/app/assets/javascripts/discourse/components/visible-component.js.es6 b/app/assets/javascripts/discourse/components/visible.js.es6 similarity index 100% rename from app/assets/javascripts/discourse/components/visible-component.js.es6 rename to app/assets/javascripts/discourse/components/visible.js.es6 diff --git a/app/assets/javascripts/discourse/templates/header.hbs b/app/assets/javascripts/discourse/templates/header.hbs index 242a8b83b36..4b8d59635d8 100644 --- a/app/assets/javascripts/discourse/templates/header.hbs +++ b/app/assets/javascripts/discourse/templates/header.hbs @@ -80,16 +80,20 @@ {{/if}} - {{render "search"}} + {{#if view.renderDropdowns}} - {{render "notifications" notifications}} + {{render "search"}} + + {{render "notifications" notifications}} + + {{#if view.renderSiteMap}} + {{render "siteMap"}} + {{/if}} + + {{render "user-dropdown"}} - {{#if view.renderSiteMap}} - {{render "siteMap"}} {{/if}} - {{render "user-dropdown"}} - {{#if showExtraInfo}} diff --git a/app/assets/javascripts/discourse/views/header.js.es6 b/app/assets/javascripts/discourse/views/header.js.es6 index f2d1c6aca7c..f256b802eff 100644 --- a/app/assets/javascripts/discourse/views/header.js.es6 +++ b/app/assets/javascripts/discourse/views/header.js.es6 @@ -14,16 +14,26 @@ export default Discourse.View.extend({ classNames: ['d-header', 'clearfix'], classNameBindings: ['editingTopic'], templateName: 'header', + renderDropdowns: false, showDropdown: function($target) { + var self = this; + + if(!this.get("renderDropdowns")){ + this.set("renderDropdowns", true); + Em.run.next(function(){ + self.showDropdown($target); + }); + return; + } + var elementId = $target.data('dropdown') || $target.data('notifications'), $dropdown = $("#" + elementId), $li = $target.closest('li'), $ul = $target.closest('ul'), $html = $('html'), $header = $('header'), - replyZIndex = parseInt($('#reply-control').css('z-index'), 10), - self = this; + replyZIndex = parseInt($('#reply-control').css('z-index'), 10); originalZIndex = originalZIndex || $('header').css('z-index'); diff --git a/app/assets/javascripts/main_include.js b/app/assets/javascripts/main_include.js index 9cf9a5a3927..79c2e6e1ecf 100644 --- a/app/assets/javascripts/main_include.js +++ b/app/assets/javascripts/main_include.js @@ -42,6 +42,7 @@ //= require ./discourse/routes/discourse_restricted_user_route //= require ./discourse/components/top-title //= require ./discourse/components/text-field +//= require ./discourse/components/visible //= require ./discourse/helpers/user-avatar //= require ./discourse/helpers/cold-age-class