temporarily disable category class on body while debugging issue with missing docking header

This commit is contained in:
Sam 2015-01-27 13:43:40 +11:00
parent 497042ddf2
commit d52b0a2458
2 changed files with 23 additions and 19 deletions

View File

@ -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')
};

View File

@ -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");