+ {{/* things are getting complicated when search tries to open the expand box while jquery sets the display CSS on the element */}}
+
- {{.Inner | safeHTML}}
+
+ {{ $content }}
\ No newline at end of file
diff --git a/static/css/theme.css b/static/css/theme.css
index 39c175fdd7..0329ef850d 100644
--- a/static/css/theme.css
+++ b/static/css/theme.css
@@ -1134,9 +1134,37 @@ option {
cursor: pointer;
}
-.expand-label i{
- font-size: x-small;
- width: 8px;
+.expand-label > .fas {
+ font-size: .8rem;
+ width: .6rem;
+}
+
+/* expander collapsed, default */
+.expand > .expand-label > .fa-chevron-down {
+ display: none;
+}
+.expand > .expand-label > .fa-chevron-right {
+ display: inline-block;
+}
+
+/* expander expanded, controlled by expand.html */
+.expand.expand-expanded > .expand-label > .fa-chevron-down {
+ display: inline-block;
+}
+.expand.expand-expanded > .expand-label > .fa-chevron-right {
+ display: none;
+}
+
+/* expander expand collapsed marked, must override logic of expand.html, controlled by relearn.js */
+.expand:not(.expand-expanded).expand-marked > .expand-label > .fa-chevron-down {
+ display: inline-block;
+}
+.expand:not(.expand-expanded).expand-marked > .expand-label > .fa-chevron-right {
+ display: none;
+}
+.expand:not(.expand-expanded).expand-marked > .expand-content {
+ /* this will disable jquery's animation */
+ display: block !important;
}
@media print {
diff --git a/static/js/relearn.js b/static/js/relearn.js
index f2afdf1217..78645bc4c5 100644
--- a/static/js/relearn.js
+++ b/static/js/relearn.js
@@ -276,18 +276,22 @@ jQuery(function() {
$('ul.topics').removeClass('searched');
items.css('display', 'block');
sessionStorage.removeItem('search-value');
+ $("mark").parents(".expand-marked").removeClass("expand-marked");
$(".highlightable").unhighlight({ element: 'mark' })
return;
}
sessionStorage.setItem('search-value', value);
+ $("mark").parents(".expand-marked").removeClass("expand-marked");
$(".highlightable").unhighlight({ element: 'mark' }).highlight(value, { element: 'mark' });
+ $("mark").parents(".expand").addClass("expand-marked");
if (ajax && ajax.abort) ajax.abort();
jQuery('[data-search-clear]').on('click', function() {
jQuery('[data-search-input]').val('').trigger('input');
sessionStorage.removeItem('search-input');
+ $("mark").parents(".expand-marked").removeClass("expand-marked");
$(".highlightable").unhighlight({ element: 'mark' })
});
});
@@ -314,6 +318,7 @@ jQuery(function() {
}
$(".highlightable").highlight(sessionStorage.getItem('search-value'), { element: 'mark' });
+ $("mark").parents(".expand").addClass("expand-marked");
// clipboard
var clipInit = false;