| 18 | | //Initialize needed constants |
| 19 | | var o = this.options, positioned = /^(?:r|a|f)/, element = this.element[0]; |
| 20 | | |
| 21 | | if (!this.element.length) |
| | 18 | if (this.options.helper == 'original' && !(/^(?:r|a|f)/).test(this.element.css("position"))) |
| | 19 | this.element[0].style.position = 'relative'; |
| | 20 | |
| | 21 | (this.options.disabled && this.element.addClass('ui-draggable-disabled')); |
| | 22 | |
| | 23 | this.mouseInit(); |
| | 24 | |
| | 25 | }, |
| | 26 | mouseStart: function(e) { |
| | 27 | |
| | 28 | var o = this.options; |
| | 29 | |
| | 30 | if (this.helper || o.disabled || $(e.target).is('.ui-resizable-handle')) |
| 23 | | |
| 24 | | var style = element.style || {}, |
| 25 | | position = style.position || "static"; |
| 26 | | |
| 27 | | //Position the node |
| 28 | | if (o.helper == 'original' && !positioned.test(position)) |
| 29 | | style.position = 'relative'; |
| 30 | | |
| 31 | | (o.disabled && this.element.addClass('ui-draggable-disabled')); |
| 32 | | |
| 33 | | this.mouseInit(); |
| 34 | | |
| 35 | | }, |
| 36 | | mouseStart: function(e) { |
| 37 | | var o = this.options; |
| 38 | | |
| 39 | | if (this.helper || o.disabled || $(e.target).is('.ui-resizable-handle')) return false; |
| 40 | | |
| | 32 | |
| | 33 | //Check if we have a valid handle |