mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: only remove custom CSS in admin on first load
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
export default Discourse.View.extend({
|
export default Discourse.View.extend({
|
||||||
_disableCustomStylesheets: function() {
|
_disableCustomStylesheets: function() {
|
||||||
|
if (this.session.get("disableCustomCSS")) {
|
||||||
$("link.custom-css").attr("rel", "");
|
$("link.custom-css").attr("rel", "");
|
||||||
|
this.session.set("disableCustomCSS", false);
|
||||||
|
}
|
||||||
}.on("willInsertElement"),
|
}.on("willInsertElement"),
|
||||||
|
|
||||||
_enableCustomStylesheets: function() {
|
_enableCustomStylesheets: function() {
|
||||||
|
|||||||
@@ -153,11 +153,14 @@ module ApplicationHelper
|
|||||||
MobileDetection.mobile_device?(request.user_agent)
|
MobileDetection.mobile_device?(request.user_agent)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def customization_disabled?
|
def customization_disabled?
|
||||||
session[:disable_customization]
|
session[:disable_customization]
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def loading_admin?
|
||||||
|
controller.class.name.split("::").first == "Admin"
|
||||||
|
end
|
||||||
|
|
||||||
def category_badge(category, opts=nil)
|
def category_badge(category, opts=nil)
|
||||||
CategoryBadge.html_for(category, opts).html_safe
|
CategoryBadge.html_for(category, opts).html_safe
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,7 +9,6 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
Ember.RSVP.configure('onerror', function(e) {
|
Ember.RSVP.configure('onerror', function(e) {
|
||||||
|
|
||||||
// Ignore TransitionAborted exceptions that bubble up
|
// Ignore TransitionAborted exceptions that bubble up
|
||||||
if (e && e.message === "TransitionAborted") { return; }
|
if (e && e.message === "TransitionAborted") { return; }
|
||||||
|
|
||||||
@@ -43,6 +42,7 @@
|
|||||||
Discourse.Route.mapRoutes();
|
Discourse.Route.mapRoutes();
|
||||||
Discourse.start();
|
Discourse.start();
|
||||||
Discourse.set('assetVersion','<%= Discourse.assets_digest %>');
|
Discourse.set('assetVersion','<%= Discourse.assets_digest %>');
|
||||||
|
Discourse.Session.currentProp("disableCustomCSS", <%= loading_admin? %>);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<%= script 'browser-update' %>
|
<%= script 'browser-update' %>
|
||||||
|
|||||||
Reference in New Issue
Block a user