From d52b0a2458ca1cb19aa1442c0703ff39ee05ff1d Mon Sep 17 00:00:00 2001 From: Sam Date: Tue, 27 Jan 2015 13:43:40 +1100 Subject: [PATCH] temporarily disable category class on body while debugging issue with missing docking header --- .../mixins/add-category-class.js.es6 | 39 ++++++++++--------- .../integration/topic-discovery-test.js.es6 | 3 +- 2 files changed, 23 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/discourse/mixins/add-category-class.js.es6 b/app/assets/javascripts/discourse/mixins/add-category-class.js.es6 index eb2cee215b0..35621ae5bce 100644 --- a/app/assets/javascripts/discourse/mixins/add-category-class.js.es6 +++ b/app/assets/javascripts/discourse/mixins/add-category-class.js.es6 @@ -2,22 +2,25 @@ // add it to the body as the view is entered / left / model is changed. // This is used for keeping the `body` style in sync for the background image. export default { - _enterView: function() { this.get('categorySlug'); }.on('init'), - - _removeClasses: function() { - $('body').removeClass(function(idx, css) { - return (css.match(/\bcategory-[^\b]+/g) || []).join(' '); - }); - }, - - _categoryChanged: function() { - var categorySlug = this.get('categorySlug'); - this._removeClasses(); - - if (categorySlug) { - $('body').addClass('category-' + categorySlug); - } - }.observes('categorySlug'), - - _leaveView: function() { this._removeClasses(); }.on('willDestroyElement') + // Sam: Something about this code is messing with the "docked" class on body + // it looks good, but something weird is going on. + // + // _enterView: function() { this.get('categorySlug'); }.on('init'), + // + // _removeClasses: function() { + // $('body').removeClass(function(idx, css) { + // return (css.match(/\bcategory-[^\b]+/g) || []).join(' '); + // }); + // }, + // + // _categoryChanged: function() { + // var categorySlug = this.get('categorySlug'); + // this._removeClasses(); + // + // if (categorySlug) { + // $('body').addClass('category-' + categorySlug); + // } + // }.observes('categorySlug'), + // + // _leaveView: function() { this._removeClasses(); }.on('willDestroyElement') }; diff --git a/test/javascripts/integration/topic-discovery-test.js.es6 b/test/javascripts/integration/topic-discovery-test.js.es6 index ea4dbac42c2..33425a7ac23 100644 --- a/test/javascripts/integration/topic-discovery-test.js.es6 +++ b/test/javascripts/integration/topic-discovery-test.js.es6 @@ -11,7 +11,8 @@ test("Visit Discovery Pages", function() { andThen(function() { ok(exists(".topic-list"), "The list of topics was rendered"); ok(exists('.topic-list .topic-list-item'), "has topics"); - ok($('body.category-bug').length, "has a custom css class for the category id on the body"); + // TODO enable test once fixed + // ok($('body.category-bug').length, "has a custom css class for the category id on the body"); }); visit("/categories");