aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard Worth <rdworth@gmail.com>2008-10-08 10:21:28 +0000
committerRichard Worth <rdworth@gmail.com>2008-10-08 10:21:28 +0000
commit8b7f927e4b3c4622025d81845b9e7f2b88c760d0 (patch)
tree16bc75eb1c0dc40ab64433e4e0bd49562100c0c2
parent0e9117623e0105fc0b991d97d9e9ef9f71c4e9db (diff)
downloadjquery-ui-8b7f927e4b3c4622025d81845b9e7f2b88c760d0.tar.gz
jquery-ui-8b7f927e4b3c4622025d81845b9e7f2b88c760d0.zip
added some missing draggables defaults
-rw-r--r--tests/draggable.js6
-rw-r--r--ui/ui.draggable.js21
2 files changed, 20 insertions, 7 deletions
diff --git a/tests/draggable.js b/tests/draggable.js
index 59b31a0cc..c3a4b2353 100644
--- a/tests/draggable.js
+++ b/tests/draggable.js
@@ -144,7 +144,7 @@ test("defaults", function() {
axis: false,
cancel: ":input",
connectToSortable: false,
- containment: "??? - TODO",
+ containment: false,
cursor: "default",
cursorAt: null,
delay: 0,
@@ -155,9 +155,10 @@ test("defaults", function() {
helper: "original",
iframeFix: false,
opacity: 1.0,
+ refreshPositions: false,
revert: false,
revertDuration: 500,
- scroll: true,
+ scroll: false,
scrollSensitivity: 20,
scrollSpeed: 20,
scope: "default",
@@ -165,7 +166,6 @@ test("defaults", function() {
snapMode: "both",
snapTolerance: 20,
stack: "??? - TODO",
- refreshPositions: false,
zIndex: null
};
diff --git a/ui/ui.draggable.js b/ui/ui.draggable.js
index d1d4e1b8c..c830671eb 100644
--- a/ui/ui.draggable.js
+++ b/ui/ui.draggable.js
@@ -308,7 +308,7 @@ $.widget("ui.draggable", $.extend({}, $.ui.mouse, {
if((this.options.revert == "invalid" && !dropped) || (this.options.revert == "valid" && dropped) || this.options.revert === true || ($.isFunction(this.options.revert) && this.options.revert.call(this.element, dropped))) {
var self = this;
- $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10) || 500, function() {
+ $(this.helper).animate(this.originalPosition, parseInt(this.options.revertDuration, 10), function() {
self._propagate("stop", e);
self._clear();
});
@@ -355,10 +355,25 @@ $.extend($.ui.draggable, {
appendTo: "parent",
axis: false,
cancel: ":input",
+ connectToSortable: false,
+ containment: false,
+ cursor: "default",
delay: 0,
distance: 1,
+ grid: false,
helper: "original",
+ iframeFix: false,
+ opacity: 1,
+ refreshPositions: false,
+ revert: false,
+ revertDuration: 500,
scope: "default",
+ scroll: false,
+ scrollSensitivity: 20,
+ scrollSpeed: 20,
+ snap: false,
+ snapMode: "both",
+ snapTolerance: 20,
cssNamespace: "ui"
}
});
@@ -417,8 +432,6 @@ $.ui.plugin.add("draggable", "scroll", {
start: function(e, ui) {
var o = ui.options;
var i = $(this).data("draggable");
- o.scrollSensitivity = o.scrollSensitivity || 20;
- o.scrollSpeed = o.scrollSpeed || 20;
i.overflowY = function(el) {
do { if(/auto|scroll/.test(el.css('overflow')) || (/auto|scroll/).test(el.css('overflow-y'))) return el; el = el.parent(); } while (el[0].parentNode);
@@ -487,7 +500,7 @@ $.ui.plugin.add("draggable", "snap", {
drag: function(e, ui) {
var inst = $(this).data("draggable");
- var d = ui.options.snapTolerance || 20;
+ var d = ui.options.snapTolerance;
var x1 = ui.absolutePosition.left, x2 = x1 + inst.helperProportions.width,
y1 = ui.absolutePosition.top, y2 = y1 + inst.helperProportions.height;