mirror of
https://github.com/BookStackApp/BookStack.git
synced 2025-07-28 17:02:04 +03:00
Input WYSIWYG: Added dynamic options for entity selector popups
So that multiple elements on the page can share the same popup, with different search options.
This commit is contained in:
@ -14,6 +14,8 @@ export class PagePicker extends Component {
|
||||
this.defaultDisplay = this.$refs.defaultDisplay;
|
||||
this.buttonSep = this.$refs.buttonSeperator;
|
||||
|
||||
this.selectorEndpoint = this.$opts.selectorEndpoint;
|
||||
|
||||
this.value = this.input.value;
|
||||
this.setupListeners();
|
||||
}
|
||||
@ -33,6 +35,10 @@ export class PagePicker extends Component {
|
||||
const selectorPopup = window.$components.first('entity-selector-popup');
|
||||
selectorPopup.show(entity => {
|
||||
this.setValue(entity.id, entity.name);
|
||||
}, '', {
|
||||
searchEndpoint: this.selectorEndpoint,
|
||||
entityTypes: 'page',
|
||||
entityPermission: 'view',
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user