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