diff options
-rw-r--r-- | Gruntfile.js | 9 | ||||
-rw-r--r-- | src/jquery-ui-sliderAccess.js | 10 |
2 files changed, 14 insertions, 5 deletions
diff --git a/Gruntfile.js b/Gruntfile.js index 2b5afa1..b184310 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -65,7 +65,14 @@ module.exports = function(grunt) { }, }, jasmine: { - files: ['test/**/*.html'] + src: 'src/<%= pkg.name %>.js', + options: { + specs: 'test/*_spec.js', + vendor: [ + 'http://code.jquery.com/jquery-1.10.1.min.js', + 'http://code.jquery.com/ui/1.10.3/jquery-ui.min.js' + ] + } }, jshint: { gruntfile: { diff --git a/src/jquery-ui-sliderAccess.js b/src/jquery-ui-sliderAccess.js index a54cf4a..b075c66 100644 --- a/src/jquery-ui-sliderAccess.js +++ b/src/jquery-ui-sliderAccess.js @@ -17,8 +17,9 @@ options = options || {}; options.touchonly = options.touchonly !== undefined? options.touchonly : true; // by default only show it if touch device - if(options.touchonly === true && !("ontouchend" in document)) + if(options.touchonly === true && !("ontouchend" in document)){ return $(this); + } return $(this).each(function(i,obj){ var $t = $(this), @@ -56,8 +57,9 @@ e.preventDefault(); - if(newval < minval || newval > maxval) + if(newval < minval || newval > maxval){ return; + } $t.slider('value', newval); @@ -77,8 +79,8 @@ // adjust the width so we don't break the original layout var bOuterWidth = $buttons.css({ - marginLeft: ((o.where == 'after' && !o.isRTL) || (o.where == 'before' && o.isRTL)? 10:0), - marginRight: ((o.where == 'before' && !o.isRTL) || (o.where == 'after' && o.isRTL)? 10:0) + marginLeft: ((o.where === 'after' && !o.isRTL) || (o.where === 'before' && o.isRTL)? 10:0), + marginRight: ((o.where === 'before' && !o.isRTL) || (o.where === 'after' && o.isRTL)? 10:0) }).outerWidth(true) + 5; var tOuterWidth = $t.outerWidth(true); $t.css('display','inline-block').width(tOuterWidth-bOuterWidth); |