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 = document.getElementById("viewbtn");
|
||||||
btn.disabled = true;
|
btn.disabled = true;
|
||||||
btn.innerHTML = "Requesting...";
|
btn.innerHTML = "Requesting...";
|
||||||
const form = new FormData();
|
const form = new FormData();
|
||||||
const xhr = new XMLHttpRequest();
|
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.open("get", `/view_more/${pid}/${sort}/${offset}?ids=${ids}`);
|
||||||
xhr.setRequestHeader('xhr', 'xhr');
|
xhr.setRequestHeader('xhr', 'xhr');
|
||||||
xhr.onload=function(){
|
xhr.onload=function(){
|
||||||
|
|
|
@ -767,7 +767,7 @@
|
||||||
|
|
||||||
{% if offset %}
|
{% if offset %}
|
||||||
<br>
|
<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 %}
|
{% endif %}
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
Loading…
Reference in New Issue