]> BookStack Code Mirror - bookstack/blobdiff - resources/js/components/entity-selector-popup.js
Text: Tweaks to EN text for consistency/readability
[bookstack] / resources / js / components / entity-selector-popup.js
index e21e67fb33ebb2b6e1ec914d30d425114857bce4..6fb461968859ece0ad0f8934743c42e4f97c13d0 100644 (file)
@@ -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();
     }