Move openBanWindow to its own separate file
It is now shared between the admin view and the inline view. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -32,13 +32,15 @@
|
||||
{{block.super}}
|
||||
<script src="{% static 'board/jquery.js' %}"></script>
|
||||
<script src="{% static 'board/winbox.bundle.js' %}"></script>
|
||||
<script src="{% static 'board/ban_window.js' %}"></script>
|
||||
{% endblock extrahead %}
|
||||
|
||||
{% block footer %}
|
||||
{{block.super}}
|
||||
<script>
|
||||
|
||||
function openBanWindow(e) {
|
||||
/*
|
||||
function openBanWindow(e, banUrl) {
|
||||
e.preventDefault();
|
||||
let banUrl = e.target.getAttribute("data-ban-url");
|
||||
if (window.banWindow) {
|
||||
@@ -55,12 +57,13 @@ function openBanWindow(e) {
|
||||
}
|
||||
});
|
||||
}
|
||||
*/
|
||||
|
||||
function onLoad(e) {
|
||||
window.banWindow = null;
|
||||
}
|
||||
|
||||
$(".ban_link").on("click", openBanWindow);
|
||||
$(".ban_link").on("click", (e) => { openBanWindow(e, $(e.target).attr("data-ban-url")); });
|
||||
$(window).on("load", onLoad);
|
||||
</script>
|
||||
{% endblock %}
|
||||
Reference in New Issue
Block a user