diff --git a/wagtail/wagtailadmin/static_src/wagtailadmin/js/page-editor.js b/wagtail/wagtailadmin/static_src/wagtailadmin/js/page-editor.js index e81844d3c5..f12a17dd62 100644 --- a/wagtail/wagtailadmin/static_src/wagtailadmin/js/page-editor.js +++ b/wagtail/wagtailadmin/static_src/wagtailadmin/js/page-editor.js @@ -32,6 +32,14 @@ function makeRichTextEditable(id) { removeStylingPending = false; } + /* Workaround for faulty change-detection in hallo */ + function setModified() { + var hallo = richText.data('IKS-hallo'); + if (hallo) { + hallo.setModified(); + } + } + var closestObj = input.closest('.object'); richText.hallo({ @@ -44,8 +52,11 @@ function makeRichTextEditable(id) { setTimeout(removeStyling, 100); removeStylingPending = true; } - }).bind('paste', function(event, data) { - setTimeout(removeStyling, 1); + }).bind('paste drop', function(event, data) { + setTimeout(function() { + removeStyling(); + setModified(); + }, 1); /* Animate the fields open when you click into them. */ }).bind('halloactivated', function(event, data) { $(event.target).addClass('expanded', 200, function(e) {