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

Bug IE: Flotr.DOM.node : use removeChild to detach the element from the DIV, and prevent to be removed when div.innerHTML is called #300

Open
Kobee1203 opened this issue Mar 18, 2015 · 0 comments

Comments

@Kobee1203
Copy link

I try to define my own legend container.

But in IE, when the following lines is called, the created table is empty :

if(legend.container){
  table = D.node(table);
  this.legend.markup = table;
  D.insert(legend.container, table);
}

The problem comes from the D.node function (Flotr.DOM.node) that retrieves the DOM element (variable n) after adding it to a DIV.
However, when the line DIV.innerHTML = ''; is called, the element 'n' is emptied.

One solution would be to detach the element from the DIV using removeChild:

node: function(html) {
    var div = Flotr.DOM.create('div'), n;
    div.innerHTML = html;
    /* FIX : IE: use removeChild to detach the element from the DIV, and prevent to be removed when div.innerHTML is called */
    n = div.removeChild(div.children[0]);
    div.innerHTML = '';
    return n;
  }
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

1 participant