diff --git a/index.js b/index.js index 0449e40..6ad3812 100644 --- a/index.js +++ b/index.js @@ -77,9 +77,16 @@ function Slideout(options) { this._touch = options.touch === undefined ? true : options.touch && true; this._side = options.side || 'left'; this._easing = options.fx || options.easing || 'ease'; - this._duration = parseInt(options.duration, 10) || 300; - this._tolerance = parseInt(options.tolerance, 10) || 70; - this._padding = this._translateTo = parseInt(options.padding, 10) || 256; + + var duration = parseInt(options.duration, 10); + this._duration = isNaN(duration) ? 300 : duration; + + var tolerance = parseInt(options.tolerance, 10); + this._tolerance = isNaN(tolerance) ? 70 : tolerance; + + var padding = parseInt(options.padding, 10); + this._padding = this._translateTo = isNaN(padding) ? 256 : padding; + this._orientation = this._side === 'right' ? -1 : 1; this._translateTo *= this._orientation;