|
15 | 15 | let dropdownSelected = $state(false); |
16 | 16 |
|
17 | 17 | //updates UI when 'Collection' or 'Website' is selected in search options |
| 18 | + // sets a boolean for whether or not the dropdown for collection/website was selected |
18 | 19 | let _updateSelect = function (event) { |
19 | 20 | index = event.target.value; |
20 | 21 | _root.dataset.index = event.target.value; |
21 | | - if (index == 'library') { |
22 | | - dropdownSelected = true; |
23 | | - } |
| 22 | + dropdownSelected = true; |
24 | 23 | }; |
25 | 24 |
|
26 | 25 | function isSiteBabel() { |
|
57 | 56 | if (_searchtype) { |
58 | 57 | let value = _searchtype.value; |
59 | 58 | _root.dataset.field = value; |
60 | | -
|
61 | 59 | let menuItem = _searchtype.options[_searchtype.selectedIndex]; |
62 | | -
|
63 | 60 | console.log('-- updateSearchType', value, _searchtype, menuItem); |
64 | 61 | fieldValue = menuItem.text; |
65 | 62 | } |
|
116 | 113 | const isAdvancedSearch = searchParams.get('adv') == '1'; |
117 | 114 |
|
118 | 115 | if (isSiteBabel() || isWebsiteHome()) { |
119 | | - console.log('isSiteBabel or isWebsite'); |
120 | 116 | _searchtypeValue = 'everything'; |
121 | 117 | _selectValue = 'library'; |
122 | 118 | // set _inputValue to q1 IF this is ls AND it's not a mondo collection |
123 | 119 | if (location.pathname.match('/cgi/ls') && !searchParams.has('c')) { |
124 | 120 | _inputValue = searchParams.get('q1'); |
125 | 121 | isFullView = !(searchParams.get('lmt') == 'all'); |
| 122 | + } else if (dropdownSelected) { |
| 123 | + _selectValue = index; |
126 | 124 | } |
127 | 125 | } else if (isSiteCatalog()) { |
128 | 126 | _searchtypeValue = searchParams.get('searchtype') || 'all'; |
|
0 commit comments