aboutsummaryrefslogtreecommitdiff
path: root/p/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'p/scripts')
-rw-r--r--p/scripts/main.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/p/scripts/main.js b/p/scripts/main.js
index a7cccc871..18e1573cf 100644
--- a/p/scripts/main.js
+++ b/p/scripts/main.js
@@ -207,10 +207,14 @@ function mark_favorite(active) {
}
function toggleContent(new_active, old_active) {
+ old_active.removeClass("active");
+
if (new_active.length === 0) {
return;
}
+ old_active.removeClass("current");
+
if (does_lazyload) {
new_active.find('img[data-original], iframe[data-original]').each(function () {
this.setAttribute('src', this.getAttribute('data-original'));
@@ -222,10 +226,9 @@ function toggleContent(new_active, old_active) {
if (isCollapsed) {
new_active.addClass("active");
}
- old_active.removeClass("active current");
new_active.addClass("current");
} else {
- new_active.toggleClass('active');
+ new_active.toggleClass("current");
}
var box_to_move = "html,body",