Merge pull request 'Make new table modal work when editing a issue' (#6431) from JakobDev/forgejo:tablefix into forgejo

[skip ci] due to no related tests.

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/6431
Reviewed-by: Otto <otto@codeberg.org>
This commit is contained in:
Otto 2025-01-01 17:59:28 +00:00
commit e28bd3c4d6
2 changed files with 4 additions and 1 deletions

View file

@ -357,7 +357,7 @@ export function initGlobalLinkActions() {
}); });
} }
function initGlobalShowModal() { export function initGlobalShowModal() {
// A ".show-modal" button will show a modal dialog defined by its "data-modal" attribute. // A ".show-modal" button will show a modal dialog defined by its "data-modal" attribute.
// Each "data-modal-{target}" attribute will be filled to target element's value or text-content. // Each "data-modal-{target}" attribute will be filled to target element's value or text-content.
// * First, try to query '#target' // * First, try to query '#target'

View file

@ -29,6 +29,7 @@ import {attachRefIssueContextPopup} from './contextpopup.js';
import {POST, GET} from '../modules/fetch.js'; import {POST, GET} from '../modules/fetch.js';
import {MarkdownQuote} from '@github/quote-selection'; import {MarkdownQuote} from '@github/quote-selection';
import {toAbsoluteUrl} from '../utils.js'; import {toAbsoluteUrl} from '../utils.js';
import {initGlobalShowModal} from './common-global.js';
const {csrfToken} = window.config; const {csrfToken} = window.config;
@ -471,6 +472,8 @@ async function onEditContent(event) {
tabEditor?.click(); tabEditor?.click();
} }
initGlobalShowModal();
// Show write/preview tab and copy raw content as needed // Show write/preview tab and copy raw content as needed
showElem(editContentZone); showElem(editContentZone);
hideElem(renderContent); hideElem(renderContent);