mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-30 10:58:31 -05:00
Add categories-list
css class to body for customization purposes
This commit is contained in:
parent
514a45b0c1
commit
03eb4752d1
2 changed files with 14 additions and 1 deletions
|
@ -1,3 +1,11 @@
|
|||
import UrlRefresh from 'discourse/mixins/url-refresh';
|
||||
|
||||
export default Discourse.View.extend(UrlRefresh, Discourse.ScrollTop);
|
||||
export default Discourse.View.extend(UrlRefresh, Discourse.ScrollTop, {
|
||||
_addBodyClass: function() {
|
||||
$('body').addClass('categories-list');
|
||||
}.on('didInsertElement'),
|
||||
|
||||
_removeBodyClass: function() {
|
||||
$('body').removeClass('categories-list');
|
||||
}.on('willDestroyElement')
|
||||
});
|
||||
|
|
|
@ -11,15 +11,20 @@ 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-1').length, "has a custom css class for the category id on the body");
|
||||
});
|
||||
|
||||
visit("/categories");
|
||||
andThen(function() {
|
||||
ok($('body.category-1').length === 0, "removes the custom category class");
|
||||
|
||||
ok(exists('.category'), "has a list of categories");
|
||||
ok($('body.categories-list').length, "has a custom class to indicate categories");
|
||||
});
|
||||
|
||||
visit("/top");
|
||||
andThen(function() {
|
||||
ok($('body.categories-list').length === 0, "removes the `categories-list` class");
|
||||
ok(exists('.topic-list .topic-list-item'), "has topics");
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in a new issue