#1161 new
BPere

Element.makePositioned for TD tagname

Reported by BPere | October 28th, 2010 @ 10:10 AM

I created a table with draggable elements ( div ) in droppable TD's.
When I add the TD as a droppable, the Droppables.add function will execute the method Element.makePositioned as a fix for IE
This is a correct function but it the style does not work correctly in IE when passing in TD element.

When dragging the elements into a new tablecell created after the current tablecell, everything is ok.
When dragging the elements into a new tablecell created 'before' the current tablecell, the zindex is not correctly handled.

After some research I found out that the style position:'relative' causes that problem on TD elements.

Add in prototype.js line 1964

  makePositioned: function(element) {
    element = $(element);
    if (Prototype.Browser.IE && element.nodeName == 'TD') { return element; }   
    var pos = Element.getStyle(element, 'position');
    if (pos == 'static' || !pos) {
      element._madePositioned = true;
      element.style.position = 'relative';
      // Opera returns the offset relative to the positioning context, when an
      // element is position relative but top and left have not been defined
      if (Prototype.Browser.Opera) {
        element.style.top = 0;
        element.style.left = 0;
      }
    }
    return element;
  },

I didn't test this for TBODY, THEAD or TR

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

The Prototype JavaScript library.

Shared Ticket Bins

People watching this ticket

Tags

Pages