|
|
|
@ -1,5 +1,6 @@ |
|
|
|
|
// Copyright (c) 2005-2008 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
|
|
|
|
// (c) 2005-2008 Sammi Williams (http://www.oriontransfer.co.nz, sammi@oriontransfer.co.nz)
|
|
|
|
|
// script.aculo.us dragdrop.js v1.9.0, Thu Dec 23 16:54:48 -0500 2010
|
|
|
|
|
|
|
|
|
|
// Copyright (c) 2005-2010 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
|
|
|
|
//
|
|
|
|
|
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
|
|
|
|
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
|
|
|
@ -311,7 +312,7 @@ var Draggable = Class.create({ |
|
|
|
|
tag_name=='TEXTAREA')) return; |
|
|
|
|
|
|
|
|
|
var pointer = [Event.pointerX(event), Event.pointerY(event)]; |
|
|
|
|
var pos = Position.cumulativeOffset(this.element); |
|
|
|
|
var pos = this.element.cumulativeOffset(); |
|
|
|
|
this.offset = [0,1].map( function(i) { return (pointer[i] - pos[i]) }); |
|
|
|
|
|
|
|
|
|
Draggables.activate(this); |
|
|
|
@ -373,7 +374,7 @@ var Draggable = Class.create({ |
|
|
|
|
if (this.options.scroll == window) { |
|
|
|
|
with(this._getWindowScroll(this.options.scroll)) { p = [ left, top, left+width, top+height ]; } |
|
|
|
|
} else { |
|
|
|
|
p = Position.page(this.options.scroll); |
|
|
|
|
p = Position.page(this.options.scroll).toArray(); |
|
|
|
|
p[0] += this.options.scroll.scrollLeft + Position.deltaX; |
|
|
|
|
p[1] += this.options.scroll.scrollTop + Position.deltaY; |
|
|
|
|
p.push(p[0]+this.options.scroll.offsetWidth); |
|
|
|
@ -454,7 +455,7 @@ var Draggable = Class.create({ |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
draw: function(point) { |
|
|
|
|
var pos = Position.cumulativeOffset(this.element); |
|
|
|
|
var pos = this.element.cumulativeOffset(); |
|
|
|
|
if(this.options.ghosting) { |
|
|
|
|
var r = Position.realOffset(this.element); |
|
|
|
|
pos[0] += r[0] - Position.deltaX; pos[1] += r[1] - Position.deltaY; |
|
|
|
@ -730,7 +731,7 @@ var Sortable = { |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// keep reference
|
|
|
|
|
this.sortables[element.id] = options; |
|
|
|
|
this.sortables[element.identify()] = options; |
|
|
|
|
|
|
|
|
|
// for onupdate
|
|
|
|
|
Draggables.addObserver(new SortableObserver(element, options.onUpdate)); |
|
|
|
@ -825,7 +826,7 @@ var Sortable = { |
|
|
|
|
hide().addClassName('dropmarker').setStyle({position:'absolute'}); |
|
|
|
|
document.getElementsByTagName("body").item(0).appendChild(Sortable._marker); |
|
|
|
|
} |
|
|
|
|
var offsets = Position.cumulativeOffset(dropon); |
|
|
|
|
var offsets = dropon.cumulativeOffset(); |
|
|
|
|
Sortable._marker.setStyle({left: offsets[0]+'px', top: offsets[1] + 'px'}); |
|
|
|
|
|
|
|
|
|
if(position=='after') |
|
|
|
|