$.ui.plugin.add("draggable", "connectToSortable", {
start: function(event, ui) {
- var inst = $(this).data("ui-draggable"), o = inst.options,
+ var inst = $(this).draggable( "instance" ), o = inst.options,
uiSortable = $.extend({}, ui, { item: inst.element });
inst.sortables = [];
$(o.connectToSortable).each(function() {
stop: function(event, ui) {
//If we are still over the sortable, we fake the stop event of the sortable, but also remove helper
- var inst = $(this).data("ui-draggable"),
+ var inst = $(this).draggable( "instance" ),
uiSortable = $.extend({}, ui, { item: inst.element });
$.each(inst.sortables, function() {
},
drag: function(event, ui) {
- var inst = $(this).data("ui-draggable"), that = this;
+ var inst = $(this).draggable( "instance" ), that = this;
$.each(inst.sortables, function() {
$.ui.plugin.add("draggable", "cursor", {
start: function() {
- var t = $("body"), o = $(this).data("ui-draggable").options;
+ var t = $("body"), o = $(this).draggable( "instance" ).options;
if (t.css("cursor")) {
o._cursor = t.css("cursor");
}
t.css("cursor", o.cursor);
},
stop: function() {
- var o = $(this).data("ui-draggable").options;
+ var o = $(this).draggable( "instance" ).options;
if (o._cursor) {
$("body").css("cursor", o._cursor);
}
$.ui.plugin.add("draggable", "opacity", {
start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data("ui-draggable").options;
+ var t = $(ui.helper), o = $(this).draggable( "instance" ).options;
if(t.css("opacity")) {
o._opacity = t.css("opacity");
}
t.css("opacity", o.opacity);
},
stop: function(event, ui) {
- var o = $(this).data("ui-draggable").options;
+ var o = $(this).draggable( "instance" ).options;
if(o._opacity) {
$(ui.helper).css("opacity", o._opacity);
}
$.ui.plugin.add("draggable", "scroll", {
start: function() {
- var i = $(this).data("ui-draggable");
+ var i = $(this).draggable( "instance" );
if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
i.overflowOffset = i.scrollParent.offset();
}
},
drag: function( event ) {
- var i = $(this).data("ui-draggable"), o = i.options, scrolled = false;
+ var i = $(this).draggable( "instance" ), o = i.options, scrolled = false;
if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
$.ui.plugin.add("draggable", "snap", {
start: function() {
- var i = $(this).data("ui-draggable"),
+ var i = $(this).draggable( "instance" ),
o = i.options;
i.snapElements = [];
drag: function(event, ui) {
var ts, bs, ls, rs, l, r, t, b, i, first,
- inst = $(this).data("ui-draggable"),
+ inst = $(this).draggable( "instance" ),
o = inst.options,
d = o.snapTolerance,
x1 = ui.offset.left, x2 = x1 + inst.helperProportions.width,
$.ui.plugin.add("draggable", "stack", {
start: function() {
var min,
- o = this.data("ui-draggable").options,
+ o = $(this).draggable( "instance" ).options,
group = $.makeArray($(o.stack)).sort(function(a,b) {
return (parseInt($(a).css("zIndex"),10) || 0) - (parseInt($(b).css("zIndex"),10) || 0);
});
$.ui.plugin.add("draggable", "zIndex", {
start: function(event, ui) {
- var t = $(ui.helper), o = $(this).data("ui-draggable").options;
+ var t = $(ui.helper), o = $(this).draggable( "instance" ).options;
if(t.css("zIndex")) {
o._zIndex = t.css("zIndex");
}
t.css("zIndex", o.zIndex);
},
stop: function(event, ui) {
- var o = $(this).data("ui-draggable").options;
+ var o = $(this).draggable( "instance" ).options;
if(o._zIndex) {
$(ui.helper).css("zIndex", o._zIndex);
}
//Overwrite the original this.element
this.element = this.element.parent().data(
- "ui-resizable", this.element.data("ui-resizable")
+ "ui-resizable", this.element.resizable( "instance" )
);
this.elementIsWrapper = true;
$.ui.plugin.add("resizable", "animate", {
stop: function( event ) {
- var that = $(this).data("ui-resizable"),
+ var that = $(this).resizable( "instance" ),
o = that.options,
pr = that._proportionallyResizeElements,
ista = pr.length && (/textarea/i).test(pr[0].nodeName),
start: function() {
var element, p, co, ch, cw, width, height,
- that = $(this).data("ui-resizable"),
+ that = $(this).resizable( "instance" ),
o = that.options,
el = that.element,
oc = o.containment,
resize: function( event ) {
var woset, hoset, isParent, isOffsetRelative,
- that = $(this).data("ui-resizable"),
+ that = $(this).resizable( "instance" ),
o = that.options,
co = that.containerOffset, cp = that.position,
pRatio = that._aspectRatio || event.shiftKey,
},
stop: function(){
- var that = $(this).data("ui-resizable"),
+ var that = $(this).resizable( "instance" ),
o = that.options,
co = that.containerOffset,
cop = that.containerPosition,
$.ui.plugin.add("resizable", "alsoResize", {
start: function () {
- var that = $(this).data("ui-resizable"),
+ var that = $(this).resizable( "instance" ),
o = that.options,
_store = function (exp) {
$(exp).each(function() {
},
resize: function (event, ui) {
- var that = $(this).data("ui-resizable"),
+ var that = $(this).resizable( "instance" ),
o = that.options,
os = that.originalSize,
op = that.originalPosition,
start: function() {
- var that = $(this).data("ui-resizable"), o = that.options, cs = that.size;
+ var that = $(this).resizable( "instance" ), o = that.options, cs = that.size;
that.ghost = that.originalElement.clone();
that.ghost
},
resize: function(){
- var that = $(this).data("ui-resizable");
+ var that = $(this).resizable( "instance" );
if (that.ghost) {
that.ghost.css({ position: "relative", height: that.size.height, width: that.size.width });
}
},
stop: function() {
- var that = $(this).data("ui-resizable");
+ var that = $(this).resizable( "instance" );
if (that.ghost && that.helper) {
that.helper.get(0).removeChild(that.ghost.get(0));
}
$.ui.plugin.add("resizable", "grid", {
resize: function() {
- var that = $(this).data("ui-resizable"),
+ var that = $(this).resizable( "instance" ),
o = that.options,
cs = that.size,
os = that.originalSize,