forked from rDrama/rDrama
actually fix viewmore
parent
e83f36eca4
commit
7370e47735
|
@ -1,10 +1,10 @@
|
|||
function view_more(pid,sort,offset,ids) {
|
||||
function view_more(t, pid, sort, offset) {
|
||||
btn = document.getElementById("viewbtn");
|
||||
btn.disabled = true;
|
||||
btn.innerHTML = "Requesting...";
|
||||
const form = new FormData();
|
||||
const xhr = new XMLHttpRequest();
|
||||
ids = ids.toString().replace(/[\[\]]/g, '')
|
||||
ids = t.dataset.ids.toString().replace(/[\[\] ]/g, '')
|
||||
xhr.open("get", `/view_more/${pid}/${sort}/${offset}?ids=${ids}`);
|
||||
xhr.setRequestHeader('xhr', 'xhr');
|
||||
xhr.onload=function(){
|
||||
|
|
|
@ -767,7 +767,7 @@
|
|||
|
||||
{% if offset %}
|
||||
<br>
|
||||
<div id="view_more-{{offset}}"><button type="button" id="viewbtn" class="btn btn-primary" data-nonce="{{g.nonce}}" data-onclick="view_more({{pid}},'{{sort}}',{{offset}},{{ids}})">VIEW MORE COMMENTS</a></div>
|
||||
<div id="view_more-{{offset}}"><button type="button" id="viewbtn" class="btn btn-primary" data-nonce="{{g.nonce}}" data-ids="{{ids}}" data-onclick="view_more(this, {{pid}},'{{sort}}',{{offset}})">VIEW MORE COMMENTS</a></div>
|
||||
{% endif %}
|
||||
|
||||
</body>
|
||||
|
|
Loading…
Reference in New Issue