FEATURE: add .admin-interface class to BODY when in admin

removes some dead code as well
This commit is contained in:
Sam Saffron 2017-05-04 15:13:32 -04:00
parent 66cc4fff2c
commit c182dcc64c
4 changed files with 13 additions and 32 deletions

View File

@ -0,0 +1,11 @@
export default Ember.Component.extend({
didInsertElement() {
this._super();
$('body').addClass('admin-interface');
},
willDestroyElement() {
this._super();
$('body').removeClass('admin-interface');
}
});

View File

@ -1,14 +0,0 @@
export default Ember.Component.extend({
willInsertElement() {
this._super();
if (this.session.get("disableCustomCSS")) {
$("link.custom-css").attr("rel", "");
this.session.set("disableCustomCSS", false);
}
},
willDestroyElement() {
this._super();
$("link.custom-css").attr("rel", "stylesheet");
}
});

View File

@ -1,4 +1,4 @@
{{#disable-custom-stylesheets class="container"}}
{{#admin-wrapper class="container"}}
<div class="row">
<div class="full-width">
@ -34,4 +34,4 @@
</div>
</div>
{{/disable-custom-stylesheets}}
{{/admin-wrapper}}

View File

@ -7,22 +7,6 @@ export default {
initialize(container) {
const messageBus = container.lookup('message-bus:main');
// subscribe to any site customizations that are loaded
$('link.custom-css').each(function() {
const split = this.href.split("/"),
id = split[split.length - 1].split(".css")[0],
self = this;
return messageBus.subscribe("/file-change/" + id, function(data) {
if (!$(self).data('orig')) {
$(self).data('orig', self.href);
}
const orig = $(self).data('orig');
self.href = orig.replace(/v=.*/, "v=" + data);
});
});
// Custom header changes
$('header.custom').each(function() {
const header = $(this);