Lines Matching refs:element
15 remove: function(element) { argument
16 this.drops = this.drops.reject(function(d) { return d.element==$(element) });
19 add: function(element) { argument
20 element = $(element);
41 Element.makePositioned(element); // fix IE
42 options.element = element;
51 if (Element.isParent(drops[i].element, deepest.element))
57 isContained: function(element, drop) { argument
60 containmentNode = element.treeNode;
62 containmentNode = element.parentNode;
67 isAffected: function(point, element, drop) { argument
69 (drop.element!=element) &&
71 this.isContained(element, drop)) &&
73 (Element.classNames(element).detect(
75 Position.within(drop.element, point[0], point[1]) );
80 Element.removeClassName(drop.element, drop.hoverclass);
86 Element.addClassName(drop.element, drop.hoverclass);
90 show: function(point, element) { argument
96 if(Droppables.isAffected(point, element, drop))
102 Position.within(drop.element, point[0], point[1]);
104 drop.onHover(element, drop.element, Position.overlap(drop.overlap, drop.element));
110 fire: function(event, element) { argument
114 if (this.isAffected([Event.pointerX(event), Event.pointerY(event)], element, this.last_active))
116 this.last_active.onDrop(element, this.last_active.element, event);
200 removeObserver: function(element) { // element instead of observer fixes mem leaks argument
201 this.observers = this.observers.reject( function(o) { return o.element==element });
228 initialize: function(element) { argument
231 reverteffect: function(element, top_offset, left_offset) { argument
233 new Effect.Move(element, { x: -left_offset, y: -top_offset, duration: dur,
237 endeffect: function(element) { argument
238 var toOpacity = typeof element._opacity == 'number' ? element._opacity : 1.0;
239 new Effect.Opacity(element, {duration:0.2, from:0.7, to:toOpacity,
242 Draggable._dragging[element] = false
257 starteffect: function(element) { argument
258 element._opacity = Element.getOpacity(element);
259 Draggable._dragging[element] = true;
260 new Effect.Opacity(element, {duration:0.2, from:element._opacity, to:0.7});
266 this.element = $(element);
269 this.handle = this.element.down('.'+options.handle, 0);
272 if(!this.handle) this.handle = this.element;
276 this._isScrollChild = Element.childOf(this.element, options.scroll);
279 Element.makePositioned(this.element); // fix IE
298 parseInt(Element.getStyle(this.element,'left') || '0'),
299 parseInt(Element.getStyle(this.element,'top') || '0')]);
303 if(typeof Draggable._dragging[this.element] != 'undefined' &&
304 Draggable._dragging[this.element]) return;
307 var src = Event.element(event);
316 var pos = Position.cumulativeOffset(this.element);
328 this.originalZ = parseInt(Element.getStyle(this.element,'z-index') || 0);
329 this.element.style.zIndex = this.options.zindex;
333 this._clone = this.element.cloneNode(true);
334 Position.absolutize(this.element);
335 this.element.parentNode.insertBefore(this._clone, this.element);
351 if(this.options.starteffect) this.options.starteffect(this.element);
357 Droppables.show(pointer, this.element);
394 Position.relativize(this.element);
399 if(success) Droppables.fire(event, this.element);
403 if(revert && typeof revert == 'function') revert = revert(this.element);
407 this.options.reverteffect(this.element,
414 this.element.style.zIndex = this.originalZ;
417 this.options.endeffect(this.element);
437 var pos = Position.cumulativeOffset(this.element);
439 var r = Position.realOffset(this.element);
468 var style = this.element.style;
509 Droppables.show(Draggables._lastPointer, this.element);
554 initialize: function(element, observer) { argument
555 this.element = $(element);
557 this.lastValue = Sortable.serialize(this.element);
561 this.lastValue = Sortable.serialize(this.element);
566 if(this.lastValue != Sortable.serialize(this.element))
567 this.observer(this.element)
576 _findRootElement: function(element) { argument
577 while (element.tagName.toUpperCase() != "BODY") {
578 if(element.id && Sortable.sortables[element.id]) return element;
579 element = element.parentNode;
583 options: function(element) { argument
584 element = Sortable._findRootElement($(element));
585 if(!element) return;
586 return Sortable.sortables[element.id];
589 destroy: function(element){ argument
590 var s = Sortable.options(element);
593 Draggables.removeObserver(s.element);
597 delete Sortable.sortables[s.element.id];
601 create: function(element) { argument
602 element = $(element);
604 element: element,
611 containment: element, // also takes array of elements (or id's); or false
626 this.destroy(element);
645 if(options.ghosting) options_for_draggable.reverteffect = function(element) {
646 element.style.top = 0;
647 element.style.left = 0;
673 Element.cleanWhitespace(element);
680 Droppables.add(element, options_for_tree);
681 options.droppables.push(element);
684 (this.findElements(element, options) || []).each( function(e) {
691 if(options.tree) e.treeNode = element;
696 (Sortable.findTreeElements(element, options) || []).each( function(e) {
698 e.treeNode = element;
704 this.sortables[element.id] = options;
707 Draggables.addObserver(new SortableObserver(element, options.onUpdate));
712 findElements: function(element, options) { argument
714 element, options.only, options.tree ? true : false, options.tag);
717 findTreeElements: function(element, options) { argument
719 element, options.only, options.tree ? true : false, options.treeTag);
722 onHover: function(element, dropon, overlap) { argument
723 if(Element.isParent(dropon, element)) return;
729 if(dropon.previousSibling != element) {
730 var oldParentNode = element.parentNode;
731 element.style.visibility = "hidden"; // fix gecko rendering
732 dropon.parentNode.insertBefore(element, dropon);
734 Sortable.options(oldParentNode).onChange(element);
735 Sortable.options(dropon.parentNode).onChange(element);
740 if(nextElement != element) {
741 var oldParentNode = element.parentNode;
742 element.style.visibility = "hidden"; // fix gecko rendering
743 dropon.parentNode.insertBefore(element, nextElement);
745 Sortable.options(oldParentNode).onChange(element);
746 Sortable.options(dropon.parentNode).onChange(element);
751 onEmptyHover: function(element, dropon, overlap) { argument
752 var oldParentNode = element.parentNode;
755 if(!Element.isParent(dropon, element)) {
777 dropon.insertBefore(element, child);
779 Sortable.options(oldParentNode).onChange(element);
780 droponOptions.onChange(element);
811 _tree: function(element, options, parent) { argument
812 var children = Sortable.findElements(element, options) || [];
821 element: element, property in Sortable._tree.child
838 tree: function(element) { argument
839 element = $(element);
840 var sortableOptions = this.options(element);
845 name: element.id,
853 container: element,
857 return Sortable._tree(element, options, root);
869 sequence: function(element) { argument
870 element = $(element);
871 var options = Object.extend(this.options(element), arguments[1] || {});
873 return $(this.findElements(element, options) || []).map( function(item) {
878 setSequence: function(element, new_sequence) { argument
879 element = $(element);
880 var options = Object.extend(this.options(element), arguments[2] || {});
883 this.findElements(element, options).each( function(n) {
898 serialize: function(element) { argument
899 element = $(element);
900 var options = Object.extend(Sortable.options(element), arguments[1] || {});
902 (arguments[1] && arguments[1].name) ? arguments[1].name : element.id);
905 return Sortable.tree(element, arguments[1]).children.map( function (item) {
910 return Sortable.sequence(element, arguments[1]).map( function(item) {
918 Element.isParent = function(child, element) { argument
919 if (!child.parentNode || child == element) return false;
920 if (child.parentNode == element) return true;
921 return Element.isParent(child.parentNode, element);
924 Element.findChildren = function(element, only, recursive, tagName) { argument
925 if(!element.hasChildNodes()) return null;
929 $A(element.childNodes).each( function(e) {
942 Element.offsetSize = function (element, type) { argument
943 return element['offset' + ((type=='vertical' || type=='height') ? 'Height' : 'Width')];