Skip to content

Commit

Permalink
Limit fixed position to offcanvas page only
Browse files Browse the repository at this point in the history
  • Loading branch information
mjradwin committed Jun 25, 2024
1 parent 4e4f499 commit 70348ac
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"config": {
"sprite": "sprite12.svg",
"csprite": "color-icons4.svg",
"clientapp": "hebcal-app-5.1.2.min.js"
"clientapp": "hebcal-app-5.1.3.min.js"
},
"type": "module",
"engines": {
Expand Down
4 changes: 2 additions & 2 deletions static/i/hebcal-app.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import Autocomplete from './autocomplete.js';

const hebcalClient = {
createCityTypeahead: function(autoSubmit) {
createCityTypeahead: function(autoSubmit, fixedPosition) {
// eslint-disable-next-line n/no-unsupported-features/node-builtins
const doFlags = navigator.userAgent.indexOf('Win') === -1;
const cityTypeaheadEl = document.getElementById('city-typeahead');
Expand All @@ -21,7 +21,7 @@ const hebcalClient = {
showAllSuggestions: true,
preventBrowserAutocomplete: true,
noEmptyQuery: true,
fixed: true,
fixed: Boolean(fixedPosition),
onBeforeFetch: (inst) => {
inst._config.notFoundMessage = undefined;
const query = cityTypeaheadEl.value;
Expand Down
7 changes: 5 additions & 2 deletions views/hebcal-results.ejs
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,10 @@ document.addEventListener('DOMContentLoaded', function() {
});
});
</script>
<% const typeaheadScript = await include('partials/script-typeahead.ejs'); -%>
<% const hebcalFormScript = await include('partials/script-hebcal-form.ejs'); -%>
<%- await include('partials/footer.ejs', {
footerScripts: {clipboard: true, tooltip: true, typeahead: true},
xtra_html: await include('partials/script-hebcal-form.ejs'),
footerScripts: {clipboard: true, tooltip: true},
xtra_html: typeaheadScript.replace('createCityTypeahead(false)',
'createCityTypeahead(true, true)') + hebcalFormScript,
}) _%>

0 comments on commit 70348ac

Please sign in to comment.