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

Skip flag for state and toggleState methods not working from v3.3.0 #411

Closed
KrunchMuffin opened this issue Dec 30, 2014 · 5 comments
Closed
Assignees
Labels
Milestone

Comments

@KrunchMuffin
Copy link

I had to revert back to 3.1.0. Seems the .bootstrapSwitch("toggleState", true) is not working correctly as the switchChange seems to be getting called again after the toggle.

    $("#TaxExempt").on("switchChange.bootstrapSwitch", function(){
        var _self = $(this);
        var retVal;
        resetPmtInfo().then(function(retVal) {
            if(!retVal)    {
                _self.bootstrapSwitch("toggleState", true);
                // _self.bootstrapSwitch("state", retVal, true);
            } else {
                updateRunningTotals();
            }
            var bsState = _self.bootstrapSwitch("state");
            $("#TaxExemptTitle").toggleClass("font-green",bsState);    
        });
    });
@KrunchMuffin
Copy link
Author

I believe I tracked it down to this line.

https://github.com/nostalgiaz/bootstrap-switch/blob/master/dist/js/bootstrap-switch.js#L497

Needs to be moved up above the previous } inside the if (!skip) {

@LostCrew LostCrew changed the title 3.3.0 - togglestate, true not working Skip flag for state and toggleState methods not working from v3.3.0 Dec 30, 2014
@LostCrew
Copy link
Member

good catch @KrunchMuffin, we were discussing it here: #335.
i will restore the previous behaviour, even though we need to also make it working for a certain case (see: #389)

@KrunchMuffin
Copy link
Author

Ahhh, I see. Thanks for letting me know.

@alph486
Copy link

alph486 commented Dec 31, 2014

Hi @LostCrew , will the restoration of the behavior be in a maintenance release shortly, or are you planning on waiting until the case you mentioned is fixed in a different major release?

@LostCrew
Copy link
Member

LostCrew commented Jan 6, 2015

@alph486 it will be included in v3.3.1.

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

3 participants