mirror of
https://github.com/moodle/moodle.git
synced 2025-01-18 22:08:20 +01:00
MDL-47736 editor_atto: added fix for IE 9 and 10
This commit is contained in:
parent
3c15d25bcf
commit
7b62567e85
@ -850,11 +850,17 @@ EditorAutosave.prototype = {
|
||||
response_json = JSON.parse(o.responseText);
|
||||
|
||||
// Revert untouched editor contents to an empty string.
|
||||
// Check for FF and Chrome.
|
||||
if (response_json.result === '<p></p>' || response_json.result === '<p><br></p>' ||
|
||||
response_json.result === '<br>') {
|
||||
response_json.result = '';
|
||||
}
|
||||
|
||||
// Check for IE 9 and 10.
|
||||
if (response_json.result === '<p> </p>' || response_json.result === '<p><br> </p>') {
|
||||
response_json.result = '';
|
||||
}
|
||||
|
||||
if (response_json.error || typeof response_json.result === 'undefined') {
|
||||
Y.log('Error occurred recovering draft text: ' + response_json.error, 'debug', LOGNAME_AUTOSAVE);
|
||||
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
|
||||
|
File diff suppressed because one or more lines are too long
@ -845,11 +845,17 @@ EditorAutosave.prototype = {
|
||||
response_json = JSON.parse(o.responseText);
|
||||
|
||||
// Revert untouched editor contents to an empty string.
|
||||
// Check for FF and Chrome.
|
||||
if (response_json.result === '<p></p>' || response_json.result === '<p><br></p>' ||
|
||||
response_json.result === '<br>') {
|
||||
response_json.result = '';
|
||||
}
|
||||
|
||||
// Check for IE 9 and 10.
|
||||
if (response_json.result === '<p> </p>' || response_json.result === '<p><br> </p>') {
|
||||
response_json.result = '';
|
||||
}
|
||||
|
||||
if (response_json.error || typeof response_json.result === 'undefined') {
|
||||
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
|
||||
} else if (response_json.result !== this.textarea.get('value')) {
|
||||
|
@ -146,11 +146,17 @@ EditorAutosave.prototype = {
|
||||
response_json = JSON.parse(o.responseText);
|
||||
|
||||
// Revert untouched editor contents to an empty string.
|
||||
// Check for FF and Chrome.
|
||||
if (response_json.result === '<p></p>' || response_json.result === '<p><br></p>' ||
|
||||
response_json.result === '<br>') {
|
||||
response_json.result = '';
|
||||
}
|
||||
|
||||
// Check for IE 9 and 10.
|
||||
if (response_json.result === '<p> </p>' || response_json.result === '<p><br> </p>') {
|
||||
response_json.result = '';
|
||||
}
|
||||
|
||||
if (response_json.error || typeof response_json.result === 'undefined') {
|
||||
Y.log('Error occurred recovering draft text: ' + response_json.error, 'debug', LOGNAME_AUTOSAVE);
|
||||
this.showMessage(M.util.get_string('errortextrecovery', 'editor_atto'), NOTIFY_WARNING, RECOVER_MESSAGE_TIMEOUT);
|
||||
|
Loading…
x
Reference in New Issue
Block a user