Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Element.makePositioned for TD tagname #166

Closed
jwestbrook opened this issue Apr 24, 2014 · 0 comments
Closed

Element.makePositioned for TD tagname #166

jwestbrook opened this issue Apr 24, 2014 · 0 comments

Comments

@jwestbrook
Copy link
Collaborator

previous lighthouse ticket #1161
by BPere


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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants