mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Remove TinyMCE change detection on insert (breaks IE8)
The detection is triggered on first load, and in IE8 the
inserted value doesn't equal the value already in the textarea field.
That's possibly due to whitespace or encoding differences,
but they have the same character length.
Tried fixing this by whitespace removal, didn't work:
if((original || '').replace(/[\s\t\n\r]/g, '') != (value || '').replace(/[\s\t\n\r]/g, '')) {
In the end, we're already detecting changes through a 5s interval
triggering the save() method on the editor if the field is focused.
The impact of this removal is that after inserting an image,
it'll take a few seconds for the change detection to kick in
(and thus highlight the "save" button and ask for confirmation
when navigating away without saving).
See d12ae82f70
for context.
This commit is contained in:
parent
d445c7e369
commit
3b8fb42654
@ -1402,16 +1402,5 @@ function sapphiremce_cleanup(type, value) {
|
||||
});
|
||||
}
|
||||
|
||||
// if we are inserting from a popup back into the editor
|
||||
// add the changed class and update the Content value
|
||||
if(type == 'insert_to_editor' && typeof tinyMCE.selectedInstance.editorId !== 'undefined') {
|
||||
var field = jQuery('#' + tinyMCE.selectedInstance.editorId);
|
||||
var original = field.val();
|
||||
if (original != value) {
|
||||
field.val(value).addClass('changed');
|
||||
field.closest('form').addClass('changed');
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user