mirror of
https://github.com/BookStackApp/BookStack.git
synced 2024-10-30 07:32:39 +01:00
Updated WYSIWYG entity link selector to set link display text
- Sets as entity name if the input is currently empty. For #2014
This commit is contained in:
parent
642db1387e
commit
1962c81742
@ -508,7 +508,15 @@ class WysiwygEditor {
|
||||
const originalField = win.document.getElementById(field_name);
|
||||
originalField.value = entity.link;
|
||||
const mceForm = originalField.closest('.mce-form');
|
||||
mceForm.querySelectorAll('input')[2].value = entity.name;
|
||||
const inputs = mceForm.querySelectorAll('input');
|
||||
|
||||
// Set text to display if not empty
|
||||
if (!inputs[1].value) {
|
||||
inputs[1].value = entity.name;
|
||||
}
|
||||
|
||||
// Set title field
|
||||
inputs[2].value = entity.name;
|
||||
});
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user