Skip to content

Commit

Permalink
Fixes destruction of placeholder
Browse files Browse the repository at this point in the history
Fixes a TypeError when trying to remove non-activated placeholder. Also removes a property added to the main element when the placeholder is created (so that it can be properly re-created on the same element).
  • Loading branch information
cpsubrian committed Aug 7, 2014
1 parent 638b5de commit 294ee5d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion medium.js
Original file line number Diff line number Diff line change
Expand Up @@ -594,9 +594,10 @@ var Medium = (function (w, d) {
settings = this.settings,
placeholder = this.placeholder || null;

if (placeholder !== null) {
if (placeholder !== null && placeholder.setup) {
//remove placeholder
placeholder.parentNode.removeChild(placeholder);
delete el.placeHolderActive;
}

//remove contenteditable
Expand Down

0 comments on commit 294ee5d

Please sign in to comment.