mirror of
https://github.com/discourse/discourse.git
synced 2025-06-07 22:34:44 +08:00
FIX: Add appropriate classes to html
element including lang
(#12245)
This was not working in the Ember CLI version of the application.
This commit is contained in:
@ -242,6 +242,10 @@
|
|||||||
head.append(theme_ids);
|
head.append(theme_ids);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let htmlElement = document.getElementsByTagName("html")[0];
|
||||||
|
htmlElement.classList = bootstrap.html_classes;
|
||||||
|
htmlElement.setAttribute("lang", bootstrap.html_lang);
|
||||||
|
|
||||||
let themeHtml = bootstrap.theme_html;
|
let themeHtml = bootstrap.theme_html;
|
||||||
let html = bootstrap.html;
|
let html = bootstrap.html;
|
||||||
|
|
||||||
|
@ -60,6 +60,8 @@ class BootstrapController < ApplicationController
|
|||||||
preloaded: @preloaded,
|
preloaded: @preloaded,
|
||||||
html: create_html,
|
html: create_html,
|
||||||
theme_html: create_theme_html,
|
theme_html: create_theme_html,
|
||||||
|
html_classes: html_classes,
|
||||||
|
html_lang: html_lang
|
||||||
}
|
}
|
||||||
bootstrap[:extra_locales] = extra_locales if extra_locales.present?
|
bootstrap[:extra_locales] = extra_locales if extra_locales.present?
|
||||||
bootstrap[:csrf_token] = form_authenticity_token if current_user
|
bootstrap[:csrf_token] = form_authenticity_token if current_user
|
||||||
|
@ -41,6 +41,9 @@ describe BootstrapController do
|
|||||||
expect(preloaded['siteSettings']).to be_present
|
expect(preloaded['siteSettings']).to be_present
|
||||||
expect(preloaded['currentUser']).to be_blank
|
expect(preloaded['currentUser']).to be_blank
|
||||||
expect(preloaded['topicTrackingStates']).to be_blank
|
expect(preloaded['topicTrackingStates']).to be_blank
|
||||||
|
|
||||||
|
expect(bootstrap['html_classes']).to eq("desktop-view not-mobile-device text-size-normal anon")
|
||||||
|
expect(bootstrap['html_lang']).to eq('en')
|
||||||
end
|
end
|
||||||
|
|
||||||
it "returns user data when authenticated" do
|
it "returns user data when authenticated" do
|
||||||
|
Reference in New Issue
Block a user