diff options
author | Richard Worth <rdworth@gmail.com> | 2008-06-07 06:10:52 +0000 |
---|---|---|
committer | Richard Worth <rdworth@gmail.com> | 2008-06-07 06:10:52 +0000 |
commit | 4f1c390e298ecaa2d74be8c96c95c7b021cac2b1 (patch) | |
tree | 9666fd517f872f9818bdbe09ccdaced74b298154 | |
parent | 182404c0c312483eab428e7e7fc8985618067884 (diff) | |
download | jquery-ui-4f1c390e298ecaa2d74be8c96c95c7b021cac2b1.tar.gz jquery-ui-4f1c390e298ecaa2d74be8c96c95c7b021cac2b1.zip |
draggable - Improved handling of unexpected values for axis option
-rw-r--r-- | ui/source/ui.draggable.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/ui/source/ui.draggable.js b/ui/source/ui.draggable.js index b79efd302..692cf20d5 100644 --- a/ui/source/ui.draggable.js +++ b/ui/source/ui.draggable.js @@ -200,8 +200,8 @@ $.widget("ui.draggable", $.extend($.ui.mouse, { //Call plugins and callbacks and use the resulting position if something is returned this.position = this.propagate("drag", e) || this.position; - if(!this.options.axis || this.options.axis == "x") this.helper[0].style.left = this.position.left+'px'; - if(!this.options.axis || this.options.axis == "y") this.helper[0].style.top = this.position.top+'px'; + if(!this.options.axis || this.options.axis != "y") this.helper[0].style.left = this.position.left+'px'; + if(!this.options.axis || this.options.axis != "x") this.helper[0].style.top = this.position.top+'px'; if($.ui.ddmanager) $.ui.ddmanager.drag(this, e); return false; @@ -256,11 +256,12 @@ $.widget("ui.draggable", $.extend($.ui.mouse, { $.extend($.ui.draggable, { defaults: { - distance: 0, - delay: 0, + appendTo: "parent", + axis: false, cancel: ":input,button", - helper: "original", - appendTo: "parent" + delay: 0, + distance: 0, + helper: "original" } }); |