amoffat / bootstrap-application-wizard

MIT License
1.85k stars 388 forks source link

Card Disable() / Enable() does not hide the card navigation link #38

Open korakanchan opened 11 years ago

korakanchan commented 11 years ago

When a card is disabled the navigation link remains.

Current Status: Research

It's unknown if current situation "works as designed" Awaiting answer from author/contributors.

korakanchan commented 11 years ago

Added hide css this.nav.addClass("hide");in disable method while hiding the card. disable: function(hideCard) { this.log("disabling"); this._disabled = true; this.nav.removeClass("active already-visited"); if (hideCard) { this.el.hide(); this.nav.addClass("hide");
} this.trigger("disabled"); return this; },

gjrtimmer commented 11 years ago

@amoffat Is this something we have to incorporate ?

Do we want to incorporate this. I have added a comment section of this code to the B3 branch for the disable() function and the enable() to show it.

What do you think ? Hide the navigation by default or do we have let it up to a parameter ?

MaarekElets commented 10 years ago

This may actually belong as a separate issue, but it presented itself while I was enabling the code from this issue and is related. Part of the enable code is to add .active to the tab. Depending on where you are toggling the enable, you might not want this behavior (it also causes an issue with items in the card if it is the immediately next card as they will be hidden if you click next). To address this, I added this code to my local version which operates on the same idea of GJRTimmer's change to .disable()....

enable: function(noactivate) { this.log("enabling");

        // Issue #38 Hiding navigation link when hide card
        // Awaiting approval
        //
        this.nav.removeClass('hide');

        //Added activate option to allow for optional immediate activation of the tab
        if (!noactivate) {
            this.nav.addClass("active");
        }
        this._disabled = false;
        this.trigger("enabled");
        return this;
    }

I'm new to github, so I'll leave it to others to decide if this needs to be considered for the main code.