mirror of
https://github.com/Hopiu/wagtail.git
synced 2026-05-22 05:51:53 +00:00
Force hallo to save changes after a paste or drag
This commit is contained in:
parent
b2962955e3
commit
a049721358
1 changed files with 13 additions and 2 deletions
|
|
@ -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) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue