Skip to content

Commit

Permalink
🔨 chore: 修复了一个小 bug
Browse files Browse the repository at this point in the history
  • Loading branch information
dlzmoe committed Sep 15, 2024
1 parent 8e944f0 commit 9466de1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dist/linuxdo-scripts.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@
methods: {
init() {
$(".topic-body .reply-to-tab[aria-expanded='false']").each(function() {
$(this).click();
if (!$(this).data("clicked")) {
$(this).click();
$(this).data("clicked", true);
}
});
}
},
Expand Down
5 changes: 4 additions & 1 deletion linuxdo-scripts.user.js
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,10 @@
methods: {
init() {
$(".topic-body .reply-to-tab[aria-expanded='false']").each(function() {
$(this).click();
if (!$(this).data("clicked")) {
$(this).click();
$(this).data("clicked", true);
}
});
}
},
Expand Down
12 changes: 11 additions & 1 deletion src/components/BasicSettings/MenuAutoexpandreply1.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,24 @@ export default {
emits: ["update:modelValue"],
methods: {
init() {
// 遍历所有 aria-expanded 为 false 的按钮
$(".topic-body .reply-to-tab[aria-expanded='false']").each(function () {
$(this).click();
// 检查按钮是否已经被点击过
if (!$(this).data("clicked")) {
// 点击按钮
$(this).click();
// 设置标识为已点击
$(this).data("clicked", true);
}
});
},
},
created() {
if (this.modelValue) {
setInterval(() => {
// 检查是否存在按钮
if ($(".topic-body .reply-to-tab").length > 0) {
this.init();
}
Expand Down

0 comments on commit 9466de1

Please sign in to comment.