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

Change button color once user votes #15

Open
jendiamond opened this issue Dec 18, 2015 · 4 comments
Open

Change button color once user votes #15

jendiamond opened this issue Dec 18, 2015 · 4 comments

Comments

@jendiamond
Copy link
Member

No description provided.

@kkchu791
Copy link

I've noticed that the

.btn-success:focus {
      background: blue;
    }

    .btn-success:active {
         background: orange; 
        }

does work, but the button refreshes itself and turns itself back into green.

@kkchu791
Copy link

This has to do with time too. So once you press the button, we want it to change color.

When it's the next day at 12:01 am, we want it to change back to the original color.

So pseudo-code

if button = Date.today
  button is green
  if button.active
   then change color the orange and keep orange
  if button = Date.tomorrow, change back to green.
end

@kkchu791
Copy link

Because the button will always refresh for the upvote when clicked, I'm not sure if it's possible to keep the color change constant.

@kkchu791
Copy link

I think we want something like this.. but no idea how to get it to work

:disabled => if topic.votes.count .after> topic.votes.count.before

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

No branches or pull requests

3 participants