Skip to content

Commit

Permalink
fix: show modal when coming from autofill result
Browse files Browse the repository at this point in the history
  • Loading branch information
dadatuputi committed Jan 15, 2025
1 parent fc21bb9 commit c6edca4
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions src/includes/js/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,14 @@ $(document).ready(function () {
// https://bugzilla.mozilla.org/show_bug.cgi?id=386591#c32
const autocompleted = (searchParams.has("q") && searchParams.get("q").at(-1) === '​')

// Show modal after clicking a link
const my_modal = new bootstrap.Modal(document.getElementById('exit-modal'), {focus: false});
$("#link-list a").on('click', function(event) {
$('#exit-modal .modal-header .title').text($(this).prop('title'));
$('#exit-modal .link').text($(this).prop('href'));
my_modal.toggle();
});

function updateSearchParams(newParams) {
var params = ""
if (newParams) {
Expand Down Expand Up @@ -70,12 +78,5 @@ $(document).ready(function () {

$("#search-form").val(searchParams.get("q")).change();
}

// Show modal after clicking a link
const my_modal = new bootstrap.Modal(document.getElementById('exit-modal'), {focus: false});
$("#link-list a").on('click', function(event) {
$('#exit-modal .modal-header .title').text($(this).prop('title'));
$('#exit-modal .link').text($(this).prop('href'));
my_modal.toggle();
});

});
2 changes: 1 addition & 1 deletion updater.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ if (environment === 'production') {
}
} else {
locals = {
baseurl: "http://dev.lan:4000",
baseurl: "http://127.0.0.1:4000",
suggesturl: "http://aflink-autocomplete.aswang.workers.dev/search/{searchTerms}"
}
}
Expand Down

0 comments on commit c6edca4

Please sign in to comment.