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

fixing regex to verify hash is numeric #271

Open
wants to merge 2 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
28 changes: 13 additions & 15 deletions dist/jquery.superslides.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*! Superslides - v0.6.1 - 2013-07-09
/*! Superslides - v0.6.1 - 2014-10-01
* https://github.com/nicinabox/superslides
* Copyright (c) 2013 Nic Aitch; Licensed MIT */
* Copyright (c) 2014 Nic Aitch; Licensed MIT */
(function(window, $) {

var Superslides, plugin = 'superslides';
Expand Down Expand Up @@ -209,7 +209,7 @@ var css = {

$children.css({
position: 'absolute',
overflow: 'hidden',
overflow: that.options.scrollable? 'auto' : 'hidden',
height: '100%',
width: that.width,
top: 0,
Expand Down Expand Up @@ -446,7 +446,7 @@ Superslides.prototype = {
} else if ((/prev/).test(direction)) {
return this._prevInDom();

} else if ((/\d/).test(direction)) {
} else if ((/^\d+$/).test(direction)) {
return +direction;

} else if (direction && (/\w/).test(direction)) {
Expand Down Expand Up @@ -529,7 +529,7 @@ Superslides.prototype = {
},

stop: function() {
clearInterval(this.play_id);
clearTimeout(this.play_id);
delete this.play_id;

this.$el.trigger('stopped.slides');
Expand All @@ -544,16 +544,6 @@ Superslides.prototype = {
this.animate();
}

if (this.options.play) {
if (this.play_id) {
this.stop();
}

this.play_id = setInterval(function() {
that.animate();
}, this.options.play);
}

this.$el.trigger('started.slides');
},

Expand Down Expand Up @@ -610,6 +600,14 @@ Superslides.prototype = {
userCallback();
}

if (that.options.play) {
clearTimeout(that.play_id);

that.play_id = setTimeout(function() {
that.animate();
}, that.options.play);
}

that.animating = false;
that.$el.trigger('animated.slides');

Expand Down
6 changes: 3 additions & 3 deletions dist/jquery.superslides.min.js

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

2 changes: 1 addition & 1 deletion src/core_prototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Superslides.prototype = {
} else if ((/prev/).test(direction)) {
return this._prevInDom();

} else if ((/\d/).test(direction)) {
} else if ((/^\d+$/).test(direction)) {
return +direction;

} else if (direction && (/\w/).test(direction)) {
Expand Down
2 changes: 1 addition & 1 deletion src/css.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ var css = {

$children.css({
position: 'absolute',
overflow: 'hidden',
overflow: that.options.scrollable? 'auto' : 'hidden',
height: '100%',
width: that.width,
top: 0,
Expand Down