misc: adapt to godo changes (#89633)
gitea/wcs/pipeline/head This commit looks good Details

This commit is contained in:
Frédéric Péters 2024-04-16 11:42:35 +02:00
parent 62d178f73c
commit 291fea5b8b
2 changed files with 4 additions and 8 deletions

View File

@ -3223,7 +3223,7 @@ aside .bo-block.documentation {
}
.godo.html-edition,
.godo.html-edition--show {
.godo.html-edition.is-editable {
--padding: 0.5em;
outline: none;
background: transparent;
@ -3238,7 +3238,7 @@ aside .bo-block.documentation {
}
}
.godo.html-edition--show {
.godo.html-edition.is-editable {
.godo--editor > :first-child {
padding-top: var(--padding);
}

View File

@ -549,8 +549,6 @@ $(function() {
const documentation_save_button = document.querySelector('.bo-block.documentation button.save')
var clear_documentation_save_marks_timeout_id = null
if (editor_link) {
document.querySelector('#documentation-editor .godo--editor').setAttribute('contenteditable', 'false')
documentation_save_button.addEventListener('click', (e) => {
editor.sourceContent = editor.getHTML()
var documentation_message = Object()
@ -594,10 +592,9 @@ $(function() {
editor_link.addEventListener('click', (e) => {
e.preventDefault()
if (editor_link.getAttribute('aria-pressed') == 'true') {
editor.validEdition()
editor.editable = false;
documentation_save_button.dispatchEvent(new Event('click'))
documentation_block.classList.remove('active')
document.querySelector('#documentation-editor .godo--editor').setAttribute('contenteditable', 'false')
editor_link.setAttribute('aria-pressed', false)
if (title_byline) title_byline.style.visibility = 'visible'
} else {
@ -612,8 +609,7 @@ $(function() {
}
if (title_byline) title_byline.style.visibility = 'hidden'
editor_link.setAttribute('aria-pressed', true)
document.querySelector('#documentation-editor .godo--editor').setAttribute('contenteditable', 'true')
editor.showEdition()
editor.editable = true;
editor.view.focus()
}
})