This repository has been archived on 2024-09-05. You can view files and clone it, but cannot push or open issues or pull requests.
shimmie2/ext/relationships/script.js

35 lines
1.8 KiB
JavaScript

document.addEventListener('DOMContentLoaded', () => {
$(".shm-relationships-parent-toggle").click(function() {
$(".shm-relationships-parent-thumbs").slideToggle("fast", function() {
if($(".shm-relationships-parent-thumbs").is(":hidden")) {
$(".shm-relationships-parent-toggle").text("show »");
Cookies.set("ui-relationships-parent-hidden", 'true');
}
else {
$(".shm-relationships-parent-toggle").text("« hide");
Cookies.set("ui-relationships-parent-hidden", 'false');
}
});
});
if(Cookies.get("ui-relationships-parent-hidden") === 'true') {
$(".shm-relationships-parent-thumbs").hide();
$(".shm-relationships-parent-toggle").text("show »");
}
$(".shm-relationships-child-toggle").click(function() {
$(".shm-relationships-child-thumbs").slideToggle("fast", function() {
if($(".shm-relationships-child-thumbs").is(":hidden")) {
$(".shm-relationships-child-toggle").text("show »");
Cookies.set("ui-relationships-child-hidden", 'true');
}
else {
$(".shm-relationships-child-toggle").text("« hide");
Cookies.set("ui-relationships-child-hidden", 'false');
}
});
});
if(Cookies.get("ui-relationships-child-hidden") === 'true') {
$(".shm-relationships-child-thumbs").hide();
$(".shm-relationships-child-toggle").text("show »");
}
});