Skip to content

Commit

Permalink
fix: code
Browse files Browse the repository at this point in the history
  • Loading branch information
dewanakl committed Oct 7, 2024
1 parent f964994 commit 8b0ce51
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion js/card.js
Original file line number Diff line number Diff line change
Expand Up @@ -208,5 +208,5 @@ export const card = (() => {
renderInnerContent,
renderContent: (comment) => renderContent(comment, true),
convertMarkdownToHTML
}
};
})();
24 changes: 12 additions & 12 deletions js/comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,17 @@ export const comment = (() => {
const tracker = storage('tracker');
const showHide = storage('comment');

const changeButton = (id, disabled) => {
const buttonMethod = ['reply', 'edit', 'remove'];

buttonMethod.forEach((v) => {
const status = document.querySelector(`[onclick="comment.${v}(this)"][data-uuid="${id}"]`);
if (status) {
status.disabled = disabled;
}
});
};

const remove = async (button) => {
if (!confirm('Are you sure?')) {
return;
Expand Down Expand Up @@ -59,17 +70,6 @@ export const comment = (() => {
document.getElementById(id).remove();
};

const changeButton = (id, disabled) => {
const buttonMethod = ['reply', 'edit', 'remove'];

buttonMethod.forEach((v) => {
const status = document.querySelector(`[onclick="comment.${v}(this)"][data-uuid="${id}"]`);
if (status) {
status.disabled = disabled;
}
});
};

const update = async (button) => {
const id = button.getAttribute('data-uuid');

Expand Down Expand Up @@ -461,5 +461,5 @@ export const comment = (() => {
update,
comment,
showOrHide,
}
};
})();
2 changes: 1 addition & 1 deletion js/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,5 +115,5 @@ export const util = (() => {
escapeHtml,
disableButton,
addLoadingCheckbox,
}
};
})();

0 comments on commit 8b0ce51

Please sign in to comment.