virt2/assets/vendor_components/jquery-wizard-master/src/bind.js

20 lines
451 B
JavaScript
Executable File

$(document).on('click', '[data-wizard]', function(e){
var href;
var $this = $(this);
var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, ''));
var wizard = $target.data('wizard');
if(!wizard){
return;
}
var method = $this.data('wizard');
if(/^(back|next|first|finish|reset)$/.test(method)){
wizard[method]();
}
e.preventDefault();
});