function quoteWizBtnDisable(act, typ) {
if (typ == 'all') {
$('.wizbtn').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
}).hide();
}
}
function quoteWizBtnEnable(act, typ) {
if (typ == 'location') {
$('.wizbtn#s1-location-continue').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
OperatingNext(ev);
}).stop(true, true).fadeIn(300);
$('.wizbtn#s1-location-cancel').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
OperatingCancel(ev);
}).stop(true, true).fadeIn(300);
} else if (typ == 'quote') {
$('.wizbtn#s2-quote-accept').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
QuoteAccept(ev);
}).stop(true, true).fadeIn(300);
$('.wizbtn#s2-quote-decline').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
QuoteDecline(ev);
}).stop(true, true).fadeIn(300);
} else if (typ == 'vehicle') {
$('.wizbtn#s3-vehicle-continue').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
VehicleContinue(ev);
}).stop(true, true).fadeIn(300);
$('.wizbtn#s3-vehicle-back').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
VehicleBack(ev);
}).stop(true, true).fadeIn(300);
} else if (typ == 'esign') {
$('.wizbtn#s4-esign-agree').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
EsignAgree(ev);
}).stop(true, true).fadeIn(300);
$('.wizbtn#s4-esign-back').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
EsignBack(ev);
}).stop(true, true).fadeIn(300);
} else if (typ == 'pay') {
$('.wizbtn#s5-pay-submit').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
PaymentSubmit(ev);
}).stop(true, true).fadeIn(300);
$('.wizbtn#s5-pay-back').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
PaymentBack(ev);
}).stop(true, true).fadeIn(300);
} else if (typ == 'receipt') {
$('.wizbtn#s6-receipt-download').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
ReceiptDownload(ev);
}).stop(true, true).fadeIn(300);
$('.wizbtn#s6-receipt-print').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
ReceiptPrint(ev);
}).stop(true, true).fadeIn(300);
$('.wizbtn#s6-receipt-back').unbind(act).bind(act, function (ev) {
ev.preventDefault();
ev.stopPropagation();
ReceiptBack(ev);
}).stop(true, true).fadeIn(300);
}
}
function quoteWizEventSet() {
$('#quotewizard').on('showStep', function (e, anchorObject, stepNumber, stepDirection, stepPosition) {
console.log('showStep called on ' + stepNumber + ' | Direction: ' + stepDirection + ' | Position: ' + stepPosition);
if (stepNumber == 0) {
quoteWizBtnEnable('click', 'location');
} else if (stepNumber == 1) {
quoteWizBtnEnable('click', 'quote');
} else if (stepNumber == 2) {
quoteWizBtnEnable('click', 'vehicle');
} else if (stepNumber == 3) {
quoteWizBtnEnable('click', 'esign');
} else if (stepNumber == 4) {
quoteWizBtnEnable('click', 'pay');
} else if (stepNumber == 5) {
quoteWizBtnEnable('click', 'receipt');
}
});
$('#quotewizard').on('leaveStep', function (e, anchorObject, stepNumber, stepDirection) {
console.log('leaveStep called on ' + stepNumber + ' | Direction: ' + stepDirection);
quoteWizBtnDisable('click', 'all');
});
}
var handleQuoteWizard = function () {
"use strict";
$('#quotewizard').smartWizard({
selected: 0,
keyNavigation: false,
autoAdjustHeight: false,
cycleSteps: false,
backButtonSupport: true,
useURLhash: false,
showStepURLhash: false,
contentCache: false,
ajaxSettings: {},
disabledSteps: [],
errorSteps: [],
hiddenSteps: [],
theme: 'default',
transitionEffect: 'fade',
transitionSpeed: 150,
toolbarSettings: {
toolbarPosition: 'bottom',
toolbarButtonPosition: 'center',
showNextButton: false,
showPreviousButton: false,
toolbarExtraButtons: [
$('').html('Cancel & Exit')
.addClass('btn btn-white wizbtn wizbtn-location').hide(),
$('').html('Continue')
.addClass('btn btn-primary wizbtn wizbtn-location').hide(),
$('').html('Decline & Go Back')
.addClass('btn btn-white wizbtn wizbtn-quote').hide(),
$('').html('Accept Quote')
.addClass('btn btn-primary wizbtn wizbtn-quote').hide(),
$('').html('Go Back')
.addClass('btn btn-white wizbtn wizbtn-vehicle').hide(),
$('').html('Continue')
.addClass('btn btn-primary wizbtn wizbtn-vehicle').hide(),
$('').html('Go Back')
.addClass('btn btn-white wizbtn wizbtn-esign').hide(),
$('').html('Sign & Agree')
.addClass('btn btn-primary wizbtn wizbtn-esign').hide(),
$('').html('Go Back')
.addClass('btn btn-white wizbtn wizbtn-pay').hide(),
$('').html('Submit Payment')
.addClass('btn btn-primary wizbtn wizbtn-pay').hide(),
$('').html('Back to Dashboard')
.addClass('btn btn-white wizbtn wizbtn-receipt').hide(),
$('').html('Print')
.addClass('btn btn-primary wizbtn wizbtn-receipt').hide(),
$('').html('Download')
.addClass('btn btn-primary wizbtn wizbtn-receipt').hide()
]
},
anchorSettings: {
anchorClickable: true,
enableAllAnchors: false,
markDoneStep: true,
markAllPreviousStepsAsDone: true,
removeDoneStepOnNavigateBack: true,
enableAnchorOnDoneStep: false
}
});
};
var QuoteFormWizard = function () {
"use strict";
return {
init: function () {
handleQuoteWizard();
}
};
}();