Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Second time round, category colour doesn't show #20

Closed
gozzilli opened this issue May 4, 2016 · 3 comments
Closed

Second time round, category colour doesn't show #20

gozzilli opened this issue May 4, 2016 · 3 comments
Assignees
Labels

Comments

@gozzilli
Copy link
Collaborator

gozzilli commented May 4, 2016

No description provided.

@gozzilli gozzilli self-assigned this May 4, 2016
@gozzilli gozzilli added the bug label May 20, 2016
@PhilGrunewald
Copy link
Owner

I think I found the problem: we keep adding on class definitions on every round:
class ="btn-activity col care_self other_category"
I think we need to reset to
class ="btn-activity col"
before adding the category class...

@gozzilli
Copy link
Collaborator Author

gozzilli commented Jun 20, 2016

That's what lines 188-192 do though (or should do):

             CATEGORIES.forEach(function (cat) {
                 app.actionButtons.each(function (button) {
                     $(button).removeClass(cat);
                 });
             });

Maybe other_category is always added anyway?

Careful if you reset it to class ="btn-activity col" because then if
we change the HTML we need to remember to change the JS too..

@PhilGrunewald
Copy link
Owner

And they do.
I changed l.228 in index.js
button.addClass(activity.category || "other_category");
to
button.addClass(activity.category);
and now all seems fine - must admit that I am not sure what the || bit was for - so I hope I haven't broken something else..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants