Skip to content

Commit bb5728b

Browse files
committed
fix
1 parent d3b5dc9 commit bb5728b

1 file changed

Lines changed: 16 additions & 5 deletions

File tree

HacgGodTurn/HacgGodTurn.user.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
// @include http*://www.l-sj.cc/*
7676
// @include http*://htacg.cc/*
7777
// @include http*://www.htacg.cc/*
78-
// @version 3.21.22
78+
// @version 3.21.23
7979
// @grant GM_notification
8080
// @grant GM_xmlhttpRequest
8181
// @grant GM_setClipboard
@@ -480,10 +480,21 @@
480480
if (author && !document.querySelector("#blockBtn")) {
481481
createBlockBtn();
482482
process();
483-
var toggles = document.querySelectorAll("div.toggle-box");
484-
for(var i=0;i<toggles.length;i++){
485-
var toggle=toggles[i];
486-
toggle.style.cssText="display:block";
483+
var $=unsafeWindow.jQuery;
484+
var toggle=$(".toggle")[0];
485+
if(toggle){
486+
var evts=$._data(toggle, "events");
487+
if(!evts || !evts["click"]){
488+
$(".toggle-box").hide();
489+
$(".toggle").toggle(function(){
490+
$(this).addClass("toggle-active");
491+
}, function () {
492+
$(this).removeClass("toggle-active");
493+
});
494+
$(".toggle").click(function(){
495+
$(this).next(".toggle-box").slideToggle();
496+
});
497+
}
487498
}
488499
}
489500
});

0 commit comments

Comments
 (0)