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

Adds btnClass option to help match page if desiree #25

Open
wants to merge 4 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
50 changes: 49 additions & 1 deletion lib/jquery.stepy.css
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
@CHARSET "UTF-8";

body { font-size: 10px }
/*body { font-size: 10px }*/

.stepy-header { list-style: none; padding: 0; width: 724px }
.stepy-header li { cursor: pointer; float: left; padding: 10px }
Expand All @@ -25,6 +25,34 @@ body { font-size: 10px }
.stepy-navigator { height: 33px; margin-top: 20px }
.button-back { float: left }

.stepy-step legend {
color : #4080BF;
font : bold 1.2em arial;
letter-spacing : .7px;
padding : 0 5px 5px;
width : auto;
margin-bottom : 12px;
border-bottom : 0;
}

.stepy-step label {
/*color : #222;*/
display : block;
/*font : bold 1.5em arial;*/
letter-spacing : .7px;
margin : 10px 0 3px 1px
}

.stepy-navigator {
height : 33px;
margin-top : 20px
}

.button-back {
float : left
}

.finish,
.button-next,
.stepy-navigator input[type="submit"] { float: right }

Expand All @@ -37,3 +65,23 @@ body { font-size: 10px }
.button-back:hover,
.button-next:hover,
.stepy-navigator input[type="submit"]:hover { border-color: #BBB; color: #B07 }

.error-image {
background : url("../demo/img/error.png") no-repeat scroll right top transparent;
}

.error {
background-color : #FAF4F4;
}

label.error {
background : url("../demo/img/alert.png") no-repeat scroll 0 0 transparent;
color : #DE5130;
display : block;
float : right;
font : 10px verdana;
height : 13px;
margin : 3px 3px 0 10px;
padding-left : 21px;
padding-top : 2px;
}
13 changes: 7 additions & 6 deletions lib/jquery.stepy.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
if (self.opt.validate) {
jQuery.validator.setDefaults({ ignore: self.opt.ignore });

that.append('<div class="stepy-errors" />');
that.append('<div class="stepy-error" />');
}

self.header = methods._header.call(self);
Expand Down Expand Up @@ -170,9 +170,9 @@
}, _createBackButton: function(nav, index) {
var self = this,
that = $(this),
attributes = { href: '#', 'class': 'button-back', html: self.opt.backLabel };
attributes = { href: 'javascript:void(0);', 'class': 'button-back '+self.opt.btnClass };

$('<a />', attributes).on('click.stepy', function(e) {
$('<a />', attributes).html( self.opt.backLabel ).on('click.stepy', function(e) {
e.preventDefault();

if (!self.opt.back || methods._execute.call(self, self.opt.back, index - 1)) {
Expand Down Expand Up @@ -209,9 +209,9 @@
}, _createNextButton: function(nav, index) {
var self = this,
that = $(this),
attributes = { href: '#', 'class': 'button-next', html: self.opt.nextLabel };
attributes = { href: 'javascript:void(0);', 'class': 'button-next '+self.opt.btnClass };

$('<a/>', attributes).on('click.stepy', function(e) {
$('<a/>', attributes).html(self.opt.nextLabel).on('click.stepy', function(e) {
e.preventDefault();

if (!self.opt.next || methods._execute.call(that, self.opt.next, index + 1)) {
Expand Down Expand Up @@ -265,7 +265,7 @@
if (that.data('stepy')) {
var steps = that.data('stepy', false).children('fieldset').css('display', '');

that.children('.stepy-errors').remove();
that.children('.stepy-error').remove();
this.finish.appendTo(steps.last());
steps.find('p.stepy-navigator').remove();
}
Expand Down Expand Up @@ -394,6 +394,7 @@
back : undefined,
backLabel : '&lt; Back',
block : false, // WIP...
btnClass: '',
description : true,
duration : undefined,
enter : true,
Expand Down
39 changes: 37 additions & 2 deletions lib/jquery.stepy.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.