Skip to content

Commit 216dcb6

Browse files
committed
allow sort input to be missing
1 parent 5327a48 commit 216dcb6

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

minimal.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ <h1>Minimal User Interface Example</h1>
2222
<p>Enter a search term, e.g., groundwater. The user or group with ID <span id="displayId">(not set)</span> will be
2323
searched.</p>
2424
<form id="zoteroSearchForm" name="zoteroSearchForm">
25-
<input type="hidden" id="sort" name="sort" value="date">
2625
<input class="search-input" name="q" placeholder="Enter search term" type="text">
2726
<input type="submit" value="Search">
2827
</form>

zotero.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,10 @@ window.onload = function () {
374374
document.forms.zoteroSearchForm.q.value = query;
375375
var itemType = setSelectValue("itemType", itemTypeParam);
376376
var sort = setSelectValue("visibleSort", sortParam);
377-
document.forms.zoteroSearchForm.sort.value = sort;
377+
var sortHiddenInput = document.getElementById("sort");
378+
if (sortHiddenInput) {
379+
document.forms.zoteroSearchForm.sort.value = sort;
380+
}
378381

379382
initForm("zoteroSearchForm", expanded);
380383

0 commit comments

Comments
 (0)