Skip to content

Commit

Permalink
remove duplicated import of bootstrap and jquery library (#453)
Browse files Browse the repository at this point in the history
  • Loading branch information
allyoucanmap authored Aug 23, 2021
1 parent 275b0b6 commit 1e28765
Showing 1 changed file with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,19 @@
</div>
</nav>
{% block extra_script %}
<script src="{% static "lib/js/jquery.min.js" %}"></script>
<script src="{% static "lib/js/bootstrap.min.js" %}"></script>
<script type="text/javascript">
var signInElement = document.getElementById("sign-in")
$(function () {
manageUrlChange(signInElement)
});
$(window).bind('hashchange', function() {
manageUrlChange(signInElement)
});

function manageUrlChange(signInElement) {

if(signInElement){
var href = signInElement.getAttribute("href").split("next=")[0];
var url_parts = window.location.href.split(window.location.pathname)
var path_name = encodeURIComponent(window.location.pathname + url_parts[url_parts.length-1])
signInElement.setAttribute("href", href.concat("next=".concat(path_name)))
(function() {
function manageUrlChange(signInElement) {
var signInElement = document.getElementById("sign-in");
if(signInElement){
var href = signInElement.getAttribute("href").split("next=")[0];
var url_parts = window.location.href.split(window.location.pathname);
var path_name = encodeURIComponent(window.location.pathname + url_parts[url_parts.length-1]);
signInElement.setAttribute("href", href.concat("next=".concat(path_name)));
}
}
}

window.addEventListener('DOMContentLoaded', manageUrlChange);
window.addEventListener('hashchange', manageUrlChange, false);
})();
</script>
{% endblock extra_script %}

0 comments on commit 1e28765

Please sign in to comment.