Closed ryan-endacott closed 11 years ago
The 'toggleState' method wasn't working or implemented anywhere that I could see, so I also added that. I once again apologize if I did something wrong.
this PR needs to be cleaned up. The diffs are useless.
The diffs are useless. I dunno why all the files are changed even if they are not.
Besides from that i'm not sure that click() is the best solution.
I'm sorry. Yeah, I tried to use changeStatus, but I wasn't sure how to access it from outside of that scope.
Also, I'm not sure why the diffs got so messed up. I just changed a couple lines.
I fixed the diff. I'm not sure what had caused that.
@ryan-endacott my suggestion is to remove changeStatus
and change toggleState to be
$(this).siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
@volpino I second that
EDIT:
if (state != $(this).find('input').is(':checked'))
$(this).siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
Thanks for being understanding!
I'll implement that new togglestate.
So should the new if statement call toggle state? Or also call the $(this).siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
As changeStatus is used somewhere else you should write the function toggleState and replace changeStatus with that.
toggleState: function () {
$(this).siblings('label').trigger('mousedown').trigger('mouseup').trigger('click');
}
Then implement the new if statement to use toggleState.
:D
Alright will do!
So how would I make toggleState callable like a regular function? Or should I just replace all the calls to changeStatus with $(this).toggleButtons('toggleState'); Is there a better way of going about it?
@ryan-endacott lol almost there, now just squash those 2 commits into 1. git rebase -i HEAD~2
Done! Thanks!
You didn't replace chageStatus, could you please do that?
Yeah, I had a question about that.
So how would I make toggleState callable like a regular function? Or should I just replace all the calls to changeStatus with $(this).toggleButtons('toggleState'); Is there a better way of going about it?
$('#toggle-button').toggleButtons('toggleState');
$('#toggle-button').toggleButtons('set', true); // (or set false) will now toggle the button as expected. Feature added as requested in issue #21
Note: This is my first ever pull-request :-D So I'm sorry if I've done something wrong. Let me know how I can do better next time! I'm trying to get involved in open source!