@@ -10,40 +10,6 @@ $.widget( "oml.dragpan", {
1010 } ,
1111 vars : { } ,
1212
13- // The public functions
14- on : function ( ) {
15- // Set the cursor
16- _this . options . $parent . css ( "cursor" , _this . options . cursor ) ;
17-
18- // Disable selection dragging
19- _this . vars . $parent . css ( "-webkit-touch-callout" , "none" ) ;
20- _this . vars . $parent . css ( "-webkit-user-select" , "none" ) ;
21- _this . vars . $parent . css ( "-khtml-user-select" , "none" ) ;
22- _this . vars . $parent . css ( "-moz-user-select" , "-moz-none" ) ;
23- _this . vars . $parent . css ( "-ms-user-select" , "none" ) ;
24- _this . vars . $parent . css ( "user-select" , "none" ) ;
25-
26- // Add the mouse binding
27- this . _addMouseBinding ( ) ;
28- } ,
29- off : function ( ) {
30- // Enable selection dragging if it was enabled to begin with
31- if ( _this . vars . selection === true ) {
32- _this . vars . $parent . css ( "-webkit-touch-callout" , "all" ) ;
33- _this . vars . $parent . css ( "-webkit-user-select" , "all" ) ;
34- _this . vars . $parent . css ( "-khtml-user-select" , "all" ) ;
35- _this . vars . $parent . css ( "-moz-user-select" , "all" ) ;
36- _this . vars . $parent . css ( "-ms-user-select" , "all" ) ;
37- _this . vars . $parent . css ( "user-select" , "all" ) ;
38- }
39-
40- // Set back to default cursor
41- _this . options . $parent . css ( "cursor" , "default" ) ;
42-
43- // Remove the mouse binding
44- this . _removeMouseBinding ( ) ;
45- } ,
46-
4713 // The class construct
4814 _create : function ( ) {
4915 // This fix
@@ -161,6 +127,40 @@ $.widget( "oml.dragpan", {
161127 _removeMouseBinding : function ( ) {
162128 _this . vars . $parent . off ( ) ;
163129 _this . _dragging ( 'off' ) ;
130+ } ,
131+
132+ // The public functions
133+ on : function ( ) {
134+ // Set the cursor
135+ _this . options . $parent . css ( "cursor" , _this . options . cursor ) ;
136+
137+ // Disable selection dragging
138+ _this . vars . $parent . css ( "-webkit-touch-callout" , "none" ) ;
139+ _this . vars . $parent . css ( "-webkit-user-select" , "none" ) ;
140+ _this . vars . $parent . css ( "-khtml-user-select" , "none" ) ;
141+ _this . vars . $parent . css ( "-moz-user-select" , "-moz-none" ) ;
142+ _this . vars . $parent . css ( "-ms-user-select" , "none" ) ;
143+ _this . vars . $parent . css ( "user-select" , "none" ) ;
144+
145+ // Add the mouse binding
146+ this . _addMouseBinding ( ) ;
147+ } ,
148+ off : function ( ) {
149+ // Enable selection dragging if it was enabled to begin with
150+ if ( _this . vars . selection === true ) {
151+ _this . vars . $parent . css ( "-webkit-touch-callout" , "all" ) ;
152+ _this . vars . $parent . css ( "-webkit-user-select" , "all" ) ;
153+ _this . vars . $parent . css ( "-khtml-user-select" , "all" ) ;
154+ _this . vars . $parent . css ( "-moz-user-select" , "all" ) ;
155+ _this . vars . $parent . css ( "-ms-user-select" , "all" ) ;
156+ _this . vars . $parent . css ( "user-select" , "all" ) ;
157+ }
158+
159+ // Set back to default cursor
160+ _this . options . $parent . css ( "cursor" , "default" ) ;
161+
162+ // Remove the mouse binding
163+ this . _removeMouseBinding ( ) ;
164164 }
165165
166166} ) ;
0 commit comments