FIX: check for all parents when hiding sections
This commit is contained in:
parent
217035ced2
commit
0522002195
|
@ -1,12 +1,11 @@
|
||||||
<script type="text/discourse-plugin"
|
<script type="text/discourse-plugin" version="0.1">
|
||||||
version="0.1">
|
|
||||||
const minimumOffset = require("discourse/lib/offset-calculator").minimumOffset;
|
const minimumOffset = require("discourse/lib/offset-calculator").minimumOffset;
|
||||||
const { iconHTML } = require("discourse-common/lib/icon-library");
|
const { iconHTML } = require("discourse-common/lib/icon-library");
|
||||||
const { run } = Ember;
|
const { run } = Ember;
|
||||||
|
|
||||||
const mobileView = $("html").hasClass("mobile-view");
|
const mobileView = $("html").hasClass("mobile-view");
|
||||||
|
|
||||||
const linkIcon = iconHTML("hashtag");
|
const linkIcon = iconHTML(settings.anchor_icon);
|
||||||
const closeIcon = iconHTML("times");
|
const closeIcon = iconHTML("times");
|
||||||
const dtocIcon = iconHTML("align-left");
|
const dtocIcon = iconHTML("align-left");
|
||||||
const currUser = api.getCurrentUser();
|
const currUser = api.getCurrentUser();
|
||||||
|
@ -223,7 +222,7 @@
|
||||||
hide: function(elem) {
|
hide: function(elem) {
|
||||||
const target = $(".d-toc-subheading")
|
const target = $(".d-toc-subheading")
|
||||||
.not(elem)
|
.not(elem)
|
||||||
.not(elem.parent(".d-toc-subheading:has(.d-toc-active)"));
|
.not(elem.parents(".d-toc-subheading:has(.d-toc-active)"));
|
||||||
|
|
||||||
return target.slideUp(TOC_ANIMATION_SPEED);
|
return target.slideUp(TOC_ANIMATION_SPEED);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue