Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 19f41b7

Browse files
committed
added check to preparePreviousImages, so it doesn't create a placeholder inside a placeholder
1 parent 4864922 commit 19f41b7

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/js/medium-editor-insert-images.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@
133133
preparePreviousImages: function () {
134134
this.$el.find('.mediumInsert-images').each(function() {
135135
var $parent = $(this).parent();
136-
$parent.html($.fn.mediumInsert.insert.getButtons('images') +
137-
'<div class="mediumInsert-placeholder" draggable="true">' + $parent.html() + '</div>'
138-
);
136+
if (!$parent.hasClass('mediumInsert-placeholder')) {
137+
$parent.html($.fn.mediumInsert.insert.getButtons('images') +
138+
'<div class="mediumInsert-placeholder" draggable="true">' + $parent.html() + '</div>'
139+
);
140+
}
139141
});
140142
},
141143

0 commit comments

Comments
 (0)