1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2026-01-03 23:42:28 +03:00

Editors: Updated entity link select to pre-fill with selection

Updated all uses across both editors, so the entity link selector popup
now initates a search with the selection text if existing.

For #4571
This commit is contained in:
Dan Brown
2023-09-24 18:33:33 +01:00
parent e9664dc678
commit 21badde4ef
5 changed files with 18 additions and 5 deletions

View File

@@ -78,12 +78,13 @@ function filePickerCallback(callback, value, meta) {
if (meta.filetype === 'file') {
/** @type {EntitySelectorPopup} * */
const selector = window.$components.first('entity-selector-popup');
const selectionText = this.selection.getContent({format: 'text'}).trim();
selector.show(entity => {
callback(entity.link, {
text: entity.name,
title: entity.name,
});
});
}, selectionText);
}
if (meta.filetype === 'image') {