aboutsummaryrefslogtreecommitdiffstats
path: root/ui/ui.sortable.js
diff options
context:
space:
mode:
authorPaul Bakaus <paul.bakaus@googlemail.com>2008-06-16 12:19:31 +0000
committerPaul Bakaus <paul.bakaus@googlemail.com>2008-06-16 12:19:31 +0000
commit54adcb95022522f64512acdb25563d08d6f819ae (patch)
tree8361e7dd08da7f07bdb8e8c31fd55df0988c160c /ui/ui.sortable.js
parent5a124d14d11e4520b98ba87cdf66700bc598411a (diff)
downloadjquery-ui-54adcb95022522f64512acdb25563d08d6f819ae.tar.gz
jquery-ui-54adcb95022522f64512acdb25563d08d6f819ae.zip
sortable; moved the cursorAt and containment blocks after the start callback, allowing the helper to be resized in the start callback (fixes #3000)
Diffstat (limited to 'ui/ui.sortable.js')
-rw-r--r--ui/ui.sortable.js26
1 files changed, 14 insertions, 12 deletions
diff --git a/ui/ui.sortable.js b/ui/ui.sortable.js
index 43d962bc0..68bac5ab2 100644
--- a/ui/ui.sortable.js
+++ b/ui/ui.sortable.js
@@ -152,7 +152,7 @@ $.widget("ui.sortable", $.extend($.ui.mouse, {
this.containers = [this];
var items = this.items;
var queries = [$.isFunction(this.options.items) ? this.options.items.call(this.element) : $(this.options.items, this.element)];
-
+
if(this.options.connectWith) {
for (var i = this.options.connectWith.length - 1; i >= 0; i--){
var cur = $(this.options.connectWith[i]);
@@ -339,7 +339,15 @@ $.widget("ui.sortable", $.extend($.ui.mouse, {
};
this.originalPosition = this.generatePosition(e); //Generate the original position
+ this.domPosition = this.currentItem.prev()[0]; //Cache the former DOM position
+
+ //If o.placeholder is used, create a new element at the given position with the class
this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Cache the helper size
+ if(o.placeholder) this.createPlaceholder();
+
+ //Call plugins and callbacks
+ this.propagate("start", e);
+ this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size
if(o.cursorAt) {
if(o.cursorAt.left != undefined) this.offset.click.left = o.cursorAt.left;
@@ -348,8 +356,6 @@ $.widget("ui.sortable", $.extend($.ui.mouse, {
if(o.cursorAt.bottom != undefined) this.offset.click.top = this.helperProportions.height - o.cursorAt.bottom;
}
- this.domPosition = this.currentItem.prev()[0]; //Cache the former DOM position
-
/*
* - Position constraining -
* Here we prepare position constraining like grid and containment.
@@ -376,18 +382,14 @@ $.widget("ui.sortable", $.extend($.ui.mouse, {
];
}
}
-
- //If o.placeholder is used, create a new element at the given position with the class
- if(o.placeholder) this.createPlaceholder();
-
- //Call plugins and callbacks
- this.propagate("start", e);
- this.helperProportions = { width: this.helper.outerWidth(), height: this.helper.outerHeight() };//Recache the helper size
- if(this.options.placeholder != 'clone') this.currentItem.css('visibility', 'hidden'); //Set the original element visibility to hidden to still fill out the white space
+ //Set the original element visibility to hidden to still fill out the white space
+ if(this.options.placeholder != 'clone')
+ this.currentItem.css('visibility', 'hidden');
+ //Post 'activate' events to possible containers
if(!noActivation) {
- for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i].propagate("activate", e, this); } //Post 'activate' events to possible containers
+ for (var i = this.containers.length - 1; i >= 0; i--) { this.containers[i].propagate("activate", e, this); }
}
//Prepare possible droppables