From 20e0784c344ffcd3bd3d4b8212de9cef671b15a0 Mon Sep 17 00:00:00 2001 From: Martin Edenhofer Date: Wed, 4 Apr 2018 09:47:21 +0200 Subject: [PATCH] Fixed issue #1917. Only images in new note are lost on submit. --- app/assets/javascripts/app/lib/base/jquery.contenteditable.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/assets/javascripts/app/lib/base/jquery.contenteditable.js b/app/assets/javascripts/app/lib/base/jquery.contenteditable.js index 05b6d5567..f228ef845 100644 --- a/app/assets/javascripts/app/lib/base/jquery.contenteditable.js +++ b/app/assets/javascripts/app/lib/base/jquery.contenteditable.js @@ -540,7 +540,7 @@ // for validation, do not retrun empty content by empty tags text_plain = this.$element.text().trim() - if ( !text_plain || text_plain == '' ) { + if ( (!text_plain || text_plain == '') && !this.$element.find('img').get(0) ) { return text_plain } return this.$element.html().trim()