fix upLevel in modview added live posts

merge-requests/208/head
fatchan 4 years ago
parent 4b18607250
commit 83efa15a21
  1. 3
      gulp/res/js/forms.js
  2. 8
      gulp/res/js/live.js
  3. 2
      gulpfile.js

@ -176,6 +176,9 @@ class formHandler {
} else {
if (json.message || json.messages || json.error || json.errors) {
doModal(json);
if (json.message === 'Incorrect captcha answer') {
//todo: create captcha form, add method to captcha frontend code
}
} else if (socket && socket.connected) {
window.myPostId = json.postId;
window.location.hash = json.postId

@ -30,7 +30,7 @@ window.addEventListener('settingsReady', function(event) { //after domcontentloa
lastPostId = data.postId;
const postData = data;
//create a new post
const postHtml = post({ post: postData, modview:isModView });
const postHtml = post({ post: postData, modview:isModView, upLevel:isThread });
//add it to the end of the thread
thread.insertAdjacentHTML('beforeend', postHtml);
for (let j = 0; j < postData.quotes.length; j++) {
@ -42,14 +42,12 @@ window.addEventListener('settingsReady', function(event) { //after domcontentloa
const quotedPostData = quotedPost.querySelector('.post-data');
const newRepliesDiv = document.createElement('div');
newRepliesDiv.textContent = 'Replies: ';
['replies', 'mt-5', 'ml-5'].forEach(c => {
newRepliesDiv.classList.add(c);
});
newRepliesDiv.classList.add('replies', 'mt-5', 'ml-5');
quotedPostData.appendChild(newRepliesDiv);
replies = newRepliesDiv;
}
if (new RegExp(`>>${postData.postId}(\s|$)`).test(replies.innerText)) {
//reply link already exists (probably from a late catch up
//reply link already exists (probably from a late catch up)
continue;
}
const newReply = document.createElement('a');

@ -208,6 +208,8 @@ function scripts() {
`${paths.scripts.src}/post.js`,
`${paths.scripts.src}/settings.js`,
`${paths.scripts.src}/live.js`,
`${paths.scripts.src}/captcha.js`,
`${paths.scripts.src}/forms.js`,
`${paths.scripts.src}/*.js`,
`!${paths.scripts.src}/dragable.js`,
`!${paths.scripts.src}/hide.js`,

Loading…
Cancel
Save