fix for joan
parent
f59263c42d
commit
c49ae42205
|
@ -39,28 +39,3 @@ if (typeof showNewCommentCounts === 'undefined') {
|
|||
|
||||
setTimeout(cleanCache, 500)
|
||||
}
|
||||
|
||||
function pinPost(t, id) {
|
||||
t.disabled = true;
|
||||
t.classList.add("disabled");
|
||||
post_toast_callback(`/sticky/${id}`,
|
||||
{
|
||||
},
|
||||
(xhr) => {
|
||||
if(xhr.status == 200) {
|
||||
t.innerHTML = t.innerHTML.replace(t.textContent, 'Pin permanently')
|
||||
}
|
||||
else if(xhr.status == 201) {
|
||||
t.innerHTML = t.innerHTML.replace(t.textContent, 'Pin for 1 hour')
|
||||
t.classList.add('d-none')
|
||||
}
|
||||
t.nextElementSibling.classList.remove('d-none')
|
||||
t.disabled = false;
|
||||
t.classList.remove("disabled");
|
||||
}
|
||||
);
|
||||
setTimeout(() => {
|
||||
t.disabled = false;
|
||||
t.classList.remove("disabled");
|
||||
}, 2000);
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
function pinPost(t, id) {
|
||||
t.disabled = true;
|
||||
t.classList.add("disabled");
|
||||
post_toast_callback(`/sticky/${id}`,
|
||||
{
|
||||
},
|
||||
(xhr) => {
|
||||
if(xhr.status == 200) {
|
||||
t.innerHTML = t.innerHTML.replace(t.textContent, 'Pin permanently')
|
||||
}
|
||||
else if(xhr.status == 201) {
|
||||
t.innerHTML = t.innerHTML.replace(t.textContent, 'Pin for 1 hour')
|
||||
t.classList.add('d-none')
|
||||
}
|
||||
t.nextElementSibling.classList.remove('d-none')
|
||||
t.disabled = false;
|
||||
t.classList.remove("disabled");
|
||||
}
|
||||
);
|
||||
setTimeout(() => {
|
||||
t.disabled = false;
|
||||
t.classList.remove("disabled");
|
||||
}, 2000);
|
||||
}
|
|
@ -1099,7 +1099,11 @@
|
|||
{% endif %}
|
||||
|
||||
{% if not v or v.highlightcomments %}
|
||||
<script defer src="{{'js/submission+submission_listing.js' | asset}}"></script>
|
||||
<script defer src="{{'js/highlightcomments.js' | asset}}"></script>
|
||||
{% endif %}
|
||||
|
||||
{% if v and v.admin_level > 1 %}
|
||||
<script defer src="{{'js/pinpost.js' | asset}}"></script>
|
||||
{% endif %}
|
||||
|
||||
<script defer src="{{'js/clipboard.js' | asset}}"></script>
|
||||
|
|
|
@ -11,7 +11,11 @@
|
|||
{% endif %}
|
||||
|
||||
{% if not v or v.highlightcomments %}
|
||||
<script defer src="{{'js/submission+submission_listing.js' | asset}}"></script>
|
||||
<script defer src="{{'js/highlightcomments.js' | asset}}"></script>
|
||||
{% endif %}
|
||||
|
||||
{% if v and v.admin_level > 1 %}
|
||||
<script defer src="{{'js/pinpost.js' | asset}}"></script>
|
||||
{% endif %}
|
||||
|
||||
{% include "popover.html" %}
|
||||
|
|
Loading…
Reference in New Issue