From 71c8ae8398b347b36ca6b08e3b10493fbcf3f6af Mon Sep 17 00:00:00 2001 From: Terry Truong Date: Thu, 23 Jun 2022 17:41:23 +1000 Subject: Make suggestion-limit client-configurable --- src/App.vue | 1 + src/components/SearchModal.vue | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/App.vue b/src/App.vue index 3309879..0c9a96c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -84,6 +84,7 @@ const defaultUiOpts = { ancestryBarBgColor: '#44403c', ancestryTileMargin: 5, //px (gap between detached-ancestor tiles) infoModalImgSz: 200, + searchSuggLimit: 5, autoWaitTime: 500, //ms (time to wait between actions (with their transitions)) tutorialPaneSz: 200, tutorialPaneBgColor: '#1c1917', diff --git a/src/components/SearchModal.vue b/src/components/SearchModal.vue index 93f7a59..af6aca5 100644 --- a/src/components/SearchModal.vue +++ b/src/components/SearchModal.vue @@ -92,7 +92,8 @@ export default defineComponent({ let url = new URL(window.location.href); url.pathname = '/data/search'; url.search = '?name=' + encodeURIComponent(input.value); - url.search += (this.uiOpts.useReducedTree ? '&tree=reduced' : ''); + url.search += this.uiOpts.useReducedTree ? '&tree=reduced' : ''; + url.search += '&limit=' + this.uiOpts.searchSuggLimit; // Query server, delaying/ignoring if a request was recently sent this.pendingSuggReqUrl = url.toString(); let doReq = () => { -- cgit v1.2.3