Skip to content

Commit

Permalink
Merge pull request #238 from xieyu33333/master
Browse files Browse the repository at this point in the history
fix fixPage bug
  • Loading branch information
xieyu33333 committed Aug 2, 2015
2 parents f27e424 + f17611b commit af88493
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 5 deletions.
6 changes: 5 additions & 1 deletion build/islider.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ iSlider = function () {
// start from initIndex or 0
this.initIndex = opts.initIndex || 0;
// touchstart prevent default to fixPage
this.fixPage = opts.fixPage || true;
if (opts.fixPage === undefined) {
this.fixPage = true;
} else {
this.fixPage = opts.fixPage;
}
if (this.initIndex > this.data.length - 1 || this.initIndex < 0) {
this.initIndex = 0;
}
Expand Down
6 changes: 5 additions & 1 deletion build/islider_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ iSlider = function () {
// start from initIndex or 0
this.initIndex = opts.initIndex || 0;
// touchstart prevent default to fixPage
this.fixPage = opts.fixPage || true;
if (opts.fixPage === undefined) {
this.fixPage = true;
} else {
this.fixPage = opts.fixPage;
}
if (this.initIndex > this.data.length - 1 || this.initIndex < 0) {
this.initIndex = 0;
}
Expand Down
6 changes: 5 additions & 1 deletion demo/public/js/islider.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ iSlider = function () {
// start from initIndex or 0
this.initIndex = opts.initIndex || 0;
// touchstart prevent default to fixPage
this.fixPage = opts.fixPage || true;
if (opts.fixPage === undefined) {
this.fixPage = true;
} else {
this.fixPage = opts.fixPage;
}
if (this.initIndex > this.data.length - 1 || this.initIndex < 0) {
this.initIndex = 0;
}
Expand Down
6 changes: 5 additions & 1 deletion demo/public/js/islider_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ iSlider = function () {
// start from initIndex or 0
this.initIndex = opts.initIndex || 0;
// touchstart prevent default to fixPage
this.fixPage = opts.fixPage || true;
if (opts.fixPage === undefined) {
this.fixPage = true;
} else {
this.fixPage = opts.fixPage;
}
if (this.initIndex > this.data.length - 1 || this.initIndex < 0) {
this.initIndex = 0;
}
Expand Down
7 changes: 6 additions & 1 deletion src/islider_core.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ define('iSlider', [], function () {
// start from initIndex or 0
this.initIndex = opts.initIndex || 0;
// touchstart prevent default to fixPage
this.fixPage = opts.fixPage || true;
if (opts.fixPage === undefined) {
this.fixPage = true;
}
else {
this.fixPage = opts.fixPage;
}

if (this.initIndex > this.data.length - 1 || this.initIndex < 0) {
this.initIndex = 0;
Expand Down

0 comments on commit af88493

Please sign in to comment.