From a7a2a8b1f0ddd42af8746dc2aad03b486952cab7 Mon Sep 17 00:00:00 2001 From: Felix Niklas Date: Thu, 20 Jun 2019 09:56:27 +0200 Subject: [PATCH] KB public: fix IE11 layout bug It adds a wrapper element around the contents inside the body to workaround the wrong height calculation bug in IE11 : https://github.com/philipwalton/flexbugs#flexbug-3 Additionally it fixes a text overflow bug in grid elements. Fixes #2600 --- .../knowledge_base_public/language.js | 2 +- app/assets/stylesheets/knowledge_base.scss | 13 ++- app/views/layouts/knowledge_base.html.erb | 104 +++++++++--------- 3 files changed, 64 insertions(+), 55 deletions(-) diff --git a/app/assets/javascripts/knowledge_base_public/language.js b/app/assets/javascripts/knowledge_base_public/language.js index 9109568bc..2e459eacf 100644 --- a/app/assets/javascripts/knowledge_base_public/language.js +++ b/app/assets/javascripts/knowledge_base_public/language.js @@ -98,7 +98,7 @@ LanguageDetector.show = function(lang) { var elem = new LanguageBannerElement(lang) - document.body.prepend(elem.el) + document.querySelector('.js-wrapper').prepend(elem.el) } LanguageDetector.checkIfBetterLanguageAvailable() diff --git a/app/assets/stylesheets/knowledge_base.scss b/app/assets/stylesheets/knowledge_base.scss index 9f5c964e1..aa81412a1 100644 --- a/app/assets/stylesheets/knowledge_base.scss +++ b/app/assets/stylesheets/knowledge_base.scss @@ -99,7 +99,6 @@ body { overflow-y: scroll; display: flex; flex-direction: column; - min-height: 100vh; } h1 { @@ -240,11 +239,18 @@ b { } } +.wrapper { + display: flex; + flex-direction: column; + min-height: 100vh; +} + .header { background: $light-bg; border-bottom: 1px solid $dark-border; position: relative; padding: .3em 0 .9em; + flex-shrink: 0; .container { display: flex; @@ -422,7 +428,6 @@ b { } .main { - flex-grow: 1; display: flex; flex-direction: column; justify-content: flex-start; @@ -433,7 +438,7 @@ b { } .container { - flex: 1; + flex: 1 1 auto; display: flex; flex-direction: column; } @@ -681,6 +686,7 @@ b { span { display: block; + max-width: 100%; } } @@ -985,6 +991,7 @@ b { } .footer { + margin-top: auto; border-top: 1px solid $dark-border; background: $light-bg; color: hsl(210,8%,50%); diff --git a/app/views/layouts/knowledge_base.html.erb b/app/views/layouts/knowledge_base.html.erb index 7929e248e..ff772a339 100644 --- a/app/views/layouts/knowledge_base.html.erb +++ b/app/views/layouts/knowledge_base.html.erb @@ -12,61 +12,63 @@ <%= stylesheet_link_tag "knowledge_base.css", :media => 'all' %> <%= render 'knowledge_base/public/inline_stylesheet', knowledge_base: @knowledge_base %> -<%= render 'knowledge_base/public/top_banner', object: @object || @knowledge_base if editor? %> +
+ <%= render 'knowledge_base/public/top_banner', object: @object || @knowledge_base if editor? %> -
-
-

- <%= link_to custom_path_if_needed(help_root_path(locale: params[:locale])) do %> - - <% end %> -

- -
-
- -
- -<%= render_breadcrumb_if_needed %> - -<%= yield %> - -
-
-
+ + + <%= render_breadcrumb_if_needed %> + + <%= yield %> + +
+
+ +
+
+