|
| 1 | +/* global $: false */ |
| 2 | + |
| 3 | +(function () { |
| 4 | +"use strict"; |
| 5 | +var _this; |
| 6 | + |
1 | 7 | /*jshint -W117 */
|
2 | 8 | $.widget( "oml.dragpan", {
|
3 |
| - |
| 9 | + |
4 | 10 | // The widget default options
|
5 | 11 | _defaults: {
|
6 | 12 | speedX: 10, // X Speed default is 10
|
@@ -30,7 +36,7 @@ $.widget( "oml.dragpan", {
|
30 | 36 | }
|
31 | 37 |
|
32 | 38 | // Set up the variables used in the function
|
33 |
| - |
| 39 | + |
34 | 40 | // Set up child and parent elements
|
35 | 41 | _this.vars.$parent = _this.options.$parent;
|
36 | 42 | _this.vars.$child = _this.vars.$parent.children();
|
@@ -100,7 +106,7 @@ $.widget( "oml.dragpan", {
|
100 | 106 | }
|
101 | 107 | },
|
102 | 108 | _updateScrollPosition: function (x, y, relational) {
|
103 |
| - // If the new scroll position is in relation to the old ones |
| 109 | + // If the new scroll position is in relation to the old ones |
104 | 110 | // then update the scroll position based on them
|
105 | 111 | if ( relational === true ) {
|
106 | 112 | _this.vars.$parent.scrollLeft( _this.vars.posX + x );
|
@@ -154,7 +160,7 @@ $.widget( "oml.dragpan", {
|
154 | 160 | if (this._state() === 'off') {
|
155 | 161 | // Set the cursor
|
156 | 162 | _this.options.$parent.css( "cursor", _this.options.cursor );
|
157 |
| - |
| 163 | + |
158 | 164 | // Disable selection dragging
|
159 | 165 | _this.vars.$parent.css( "-webkit-touch-callout", "none" );
|
160 | 166 | _this.vars.$parent.css( "-webkit-user-select", "none" );
|
@@ -190,10 +196,11 @@ $.widget( "oml.dragpan", {
|
190 | 196 |
|
191 | 197 | // Remove the mouse binding
|
192 | 198 | this._removeMouseBinding();
|
193 |
| - |
| 199 | + |
194 | 200 | // Set the state to off
|
195 | 201 | _this.vars.state = 'off';
|
196 | 202 | }
|
197 | 203 | }
|
198 |
| - |
| 204 | + |
199 | 205 | });
|
| 206 | +})(); |
0 commit comments