X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/58cadce052f5cc3c9ce2bc12f88a93cac310699a..refs/pull/4729/head:/resources/js/components/entity-selector-popup.js diff --git a/resources/js/components/entity-selector-popup.js b/resources/js/components/entity-selector-popup.js index e21e67fb3..6fb461968 100644 --- a/resources/js/components/entity-selector-popup.js +++ b/resources/js/components/entity-selector-popup.js @@ -15,9 +15,21 @@ export class EntitySelectorPopup extends Component { window.$events.listen('entity-select-confirm', this.handleConfirmedSelection.bind(this)); } - show(callback) { + /** + * Show the selector popup. + * @param {Function} callback + * @param {String} searchText + * @param {EntitySelectorSearchOptions} searchOptions + */ + show(callback, searchText = '', searchOptions = {}) { this.callback = callback; + this.getSelector().configureSearchOptions(searchOptions); this.getPopup().show(); + + if (searchText) { + this.getSelector().searchText(searchText); + } + this.getSelector().focusSearch(); }