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

Commit b3cdff0

Browse files
committed
Merge pull request #268 from anilmaurya/master
Fix Uploading high quality image #267
2 parents ba25dd7 + e591b77 commit b3cdff0

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

src/js/core.js

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -177,15 +177,10 @@
177177
*/
178178

179179
Core.prototype.editorUpdatePlaceholder = function (el) {
180-
var $clone = $(el).clone(),
181-
cloneHtml;
180+
var contents = $(el).children()
181+
.not('.medium-insert-buttons').contents();
182182

183-
$clone.find('.medium-insert-buttons').remove();
184-
cloneHtml = $clone.html()
185-
.replace(/^\s+|\s+$/g, '')
186-
.replace(/^<p( class="medium-insert-active")?><br><\/p>$/, '');
187-
188-
if (!(el.querySelector('img, blockquote')) && cloneHtml === '') {
183+
if (contents.length === 1 && contents[0].nodeName.toLowerCase() === 'br') {
189184
this.showPlaceholder(el);
190185
this.base._hideInsertButtons($(el));
191186
} else {

0 commit comments

Comments
 (0)