File tree Expand file tree Collapse file tree 3 files changed +17
-7
lines changed
Expand file tree Collapse file tree 3 files changed +17
-7
lines changed Original file line number Diff line number Diff line change 22 "name" : " dragpan" ,
33 "title" : " Dragpan" ,
44 "description" : " A jQuery plugin designed to allow click and drag panning of a scrollable element" ,
5- "version" : " 1.0.0 " ,
5+ "version" : " 1.0.1 " ,
66 "homepage" : " https://github.com/lgoldstien/jquery-dragpan" ,
77 "author" : {
88 "name" : " Lawrence Goldstien" ,
Original file line number Diff line number Diff line change @@ -58,6 +58,9 @@ $.widget( "oml.dragpan", {
5858 } else {
5959 _this . options = $ . extend ( _this . _defaults , _this . options ) ;
6060 }
61+ if ( typeof _this . options . parent === 'object' ) {
62+ _this . options . $parent = _this . options . parent ;
63+ }
6164
6265 // Set up the variables used in the function
6366
Original file line number Diff line number Diff line change 4949 strictEqual ( $ ( '#parent' ) . css ( 'cursor' ) , 'all-scroll' , 'the parent should have an all-scroll cursor by default' ) ;
5050 } ) ;
5151
52- module ( 'Dragpan With Options' , {
53- setup : function ( ) {
54- this . elems = $ ( '#parent' ) . dragpan ( { cursor : 'pointer' , speedX : 50 , speedY : 60 } ) ;
55- }
56- } ) ;
52+ module ( 'Dragpan With Options' , { } ) ;
5753
5854 test ( 'Drapan uses specified cursor' , function ( ) {
5955 expect ( 1 ) ;
56+ $ ( '#parent' ) . dragpan ( { cursor : 'pointer' } ) ;
57+ strictEqual ( $ ( '#parent' ) . css ( 'cursor' ) , 'pointer' , 'the parent should have a pointer cursor for this test' ) ;
58+ } ) ;
59+
60+ test ( 'Drapan uses specified parent' , function ( ) {
61+ expect ( 1 ) ;
62+ $ ( '#child' ) . dragpan ( { parent : $ ( '#parent' ) } ) ;
6063 strictEqual ( $ ( '#parent' ) . css ( 'cursor' ) , 'pointer' , 'the parent should have a pointer cursor for this test' ) ;
6164 } ) ;
6265
6972
7073 test ( 'defaul cursor' , function ( ) {
7174 expect ( 1 ) ;
72- strictEqual ( $ ( '#parent' ) . css ( 'cursor' ) , 'default' , 'the parent should have a pointer cursor for this test' ) ;
75+ var cursor = false ;
76+ if ( $ ( '#parent' ) . css ( 'cursor' ) === 'default' || $ ( '#parent' ) . css ( 'cursor' ) === 'auto' ) {
77+ cursor = true ;
78+ }
79+ strictEqual ( cursor , true , 'the parent should have a default cursor for this test' ) ;
7380 } ) ;
7481
7582
You can’t perform that action at this time.
0 commit comments