Skip to content

Commit

Permalink
Softer method to make Safari refresh the object content
Browse files Browse the repository at this point in the history
  • Loading branch information
Pablo Ziliani committed Apr 1, 2014
1 parent 96a3969 commit 3079e96
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -442,11 +442,14 @@
el.setAttribute( "data", el.getAttribute( "data-data" ));

/**
* This is necessary to make Safari (and, apparently, old versions of Chrome)
* re-render the new content; see:
* stackoverflow.com/questions/11245385/object-works-in-every-browser-except-google-chrome
* This is necessary to make Safari 7 refresh the object's new content
*/
el.innerHTML = el.innerHTML;
var activeElement = document.activeElement;
el.focus();

if ( activeElement ) {
activeElement.focus();
}
}

return el;
Expand Down

0 comments on commit 3079e96

Please sign in to comment.