Skip to content

Instantly share code, notes, and snippets.

@heyjinkim
Created July 26, 2013 23:19
Show Gist options
  • Save heyjinkim/6092882 to your computer and use it in GitHub Desktop.
Save heyjinkim/6092882 to your computer and use it in GitHub Desktop.
Trying to fix 'Uncaught NotSupportedError' error with SVG elements in Ember template. Added "range.selectNode(range.startContainer);" on line 11.
htmlFunc = function(html, outerToo) {
// get a range for the current metamorph object
var range = rangeFor(this, outerToo);
// delete the contents of the range, which will be the
// nodes between the starting and ending placeholder.
range.deleteContents();
/* Heyjin added this line. *************************/
range.selectNode(range.startContainer);
/***************************************************/
// create a new document fragment for the HTML
var fragment = range.createContextualFragment(html);
// insert the fragment into the range
range.insertNode(fragment);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment