Skip to content

Commit

Permalink
Merge pull request #100 from cisagov/cart-2-plus-load-fix
Browse files Browse the repository at this point in the history
Cart: clear file input before opening, removes need to refresh page t…
  • Loading branch information
damionmounts authored Jul 8, 2024
2 parents 1e2315d + 72676d1 commit 872559a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions app/static/js/decider.js
Original file line number Diff line number Diff line change
Expand Up @@ -850,8 +850,10 @@ document.addEventListener('alpine:init', function () {
},

loadFromJson() {
// button -> trigger <input> file selector
document.getElementById('cartFile').click();
// button -> clear & then open <input> file selector
const fileInput = document.getElementById('cartFile');
fileInput.value = "";
fileInput.click();
},

loadFromJsonFileChanged(inputEl) {
Expand Down
4 changes: 2 additions & 2 deletions app/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ <h1 class="modal-title fs-2" id="welcomeModalLabel">Welcome to Decider!</h1>
<script src="/static/js/lib/minisearch-6.1.0/minisearch-6.1.0.min.js"></script>
<script defer src="/static/js/lib/alpinejs-3.12.2/alpinejs-focus-3.12.2.min.js"></script>
<script defer src="/static/js/lib/alpinejs-3.12.2/alpinejs-3.12.2.min.js"></script>
<script src="/static/js/decider.js?cache_bust=24feb07"></script>
<script src="/static/js/decider.js?cache_bust=24jul03"></script>
{% else %}
<script src="/static/js/lib/jquery-3.7.0.slim/jquery-3.7.0.slim.js"></script>
<script src="/static/js/lib/mark.js-9.0.0/jquery.mark.es6.js"></script>
Expand All @@ -427,7 +427,7 @@ <h1 class="modal-title fs-2" id="welcomeModalLabel">Welcome to Decider!</h1>
<script src="/static/js/lib/minisearch-6.1.0/minisearch-6.1.0.js"></script>
<script defer src="/static/js/lib/alpinejs-3.12.2/alpinejs-focus-3.12.2.js"></script>
<script defer src="/static/js/lib/alpinejs-3.12.2/alpinejs-3.12.2.js"></script>
<script src="/static/js/decider.js?cache_bust=24feb07"></script>
<script src="/static/js/decider.js?cache_bust=24jul03"></script>
{% endif %}

{{ user_additions.body_bottom() }}
Expand Down

0 comments on commit 872559a

Please sign in to comment.