Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Corrige l'affichage de l'avertissement de l'éditeur #6562

Merged
merged 1 commit into from
Dec 29, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions assets/js/editor-new.js
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@
]
})

if (smdeUniqueContent != null && localStorage['smde_' + mdeUniqueKey] !== textarea.value) {
if (smdeUniqueContent != null && localStorage['smde_' + mdeUniqueKey] !== textarea.defaultValue) {
const $alertbox = $('<div class="alert-box info"></div>')

const $hide = $("<a>Masquer l'alerte</a>")
Expand All @@ -961,7 +961,7 @@
})

const $undo = $('<a href="javascript:void(0)">cliquant ici</a>.').click(function() {
window.editors[textarea.id].value(textarea.value)
window.editors[textarea.id].value(textarea.defaultValue)
easyMDE.codemirror.off('keyHandled', onKeyHandled)
localStorage.removeItem('smde_' + mdeUniqueKey)
$alertbox.hide(() => $(this).remove())
Expand All @@ -984,7 +984,7 @@

const spanContent = [
'La version actuelle du contenu provient d\'une sauvegarde de votre navigateur. ',
'Vous pouvez revenir à la version originale (du serveur) avec CTRL+Z ou en ',
'Vous pouvez revenir à la version originale (du serveur) en ',
$undo,
'.'
]
Expand All @@ -994,7 +994,7 @@
.appendTo($alertbox)
.after($hide)

$(easyMDE.element.parentElement).children('.editor-toolbar').before($alertbox)
formEditor.find('.editor-toolbar').before($alertbox)
}

window.editors[this.id] = easyMDE
Expand Down