X-Git-Url: http://source.bookstackapp.com/bookstack/blobdiff_plain/be736b3939a428674ccab33c7aaca95c05ef6437..refs/pull/4618/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 d455f7ee7..9ff67d53e 100644 --- a/resources/js/components/entity-selector-popup.js +++ b/resources/js/components/entity-selector-popup.js @@ -1,4 +1,4 @@ -import {Component} from "./component"; +import {Component} from './component'; export class EntitySelectorPopup extends Component { @@ -15,9 +15,14 @@ export class EntitySelectorPopup extends Component { window.$events.listen('entity-select-confirm', this.handleConfirmedSelection.bind(this)); } - show(callback) { + show(callback, searchText = '') { this.callback = callback; this.getPopup().show(); + + if (searchText) { + this.getSelector().searchText(searchText); + } + this.getSelector().focusSearch(); } @@ -57,4 +62,5 @@ export class EntitySelectorPopup extends Component { this.getSelector().reset(); if (this.callback && entity) this.callback(entity); } -} \ No newline at end of file + +}