Skip to content
This repository has been archived by the owner on Jun 24, 2023. It is now read-only.

Card Disable() / Enable() update #60

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 24 additions & 22 deletions src/bootstrap-wizard.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,15 +119,12 @@
return this;
},

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

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

this.nav.addClass("active");
this.nav.removeClass('hide');
if (noActivate !== undefined) {
this.nav.addClass("active");
}
this._disabled = false;
this.trigger("enabled");
return this;
Expand All @@ -139,10 +136,7 @@
this.nav.removeClass("active already-visited");
if (hideCard) {
this.el.hide();
// Issue #38 Hiding navigation link when hide card
// Awaiting approval
//
// this.nav.addClass('hide');
this.nav.addClass('hide');
}
this.trigger("disabled");
return this;
Expand Down Expand Up @@ -597,7 +591,7 @@
errorPopover: function(el, msg, allowHtml) {
this.log("launching popover on", el);
allowHtml = typeof allowHtml !== "undefined" ? allowHtml : false;
var popover = el.popover({
var popover = el.popover('destroy').popover({
content: msg,
trigger: "manual",
html: allowHtml,
Expand Down Expand Up @@ -845,15 +839,23 @@
* any validators that trigger errorPopovers can
* display correctly
*/
if (cardToValidate.index != currentCard.index) {
cardToValidate.prev.deselect();
cardToValidate.prev.markVisited();
cardToValidate.select();
}
ok = cardToValidate.validate();
if (!ok) {
return cardToValidate;
}

if (cardToValidate.index != currentCard.index) {
cardToValidate.prev.deselect();
cardToValidate.prev.markVisited();
cardToValidate.select();
}
if (!cardToValidate.isDisabled()) {
ok = cardToValidate.validate();
}
else {
ok = true;
}

if (!ok) {
return cardToValidate;
}

cardToValidate = cardToValidate.next;
}

Expand Down
Loading