Skip to content

Commit

Permalink
draggable - Improved handling of unexpected values for axis option
Browse files Browse the repository at this point in the history
  • Loading branch information
rdworth committed Jun 7, 2008
1 parent 182404c commit 4f1c390
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions ui/source/ui.draggable.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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"
}
});

Expand Down

0 comments on commit 4f1c390

Please sign in to comment.