Skip to content
Snippets Groups Projects
Verified Commit 742d8a08 authored by Jonathan Weth's avatar Jonathan Weth :keyboard:
Browse files

Introduce text collapsible

parent b1ba6d1a
No related branches found
No related tags found
Loading
Pipeline #1199 failed
......@@ -64,4 +64,16 @@ $(document).ready( function () {
"paging": false
});
});
// Initialize text collapsibles [MAT, own work]
$(".text-collapsible").addClass("closed").removeClass("opened");
$(".text-collapsible .open-icon").click(function (e) {
var el = $(e.target).parent();
el.addClass("opened").removeClass("closed");
});
$(".text-collapsible .close-icon").click(function (e) {
var el = $(e.target).parent();
el.addClass("closed").removeClass("opened");
});
});
......@@ -368,6 +368,27 @@ main .alert p:first-child, main .alert div:first-child {
margin-right: -10px;
}
// Text collapsible
.text-collapsible > .material-icons {
font-size: 20px;
line-height: 15px;
margin-bottom: 2px;
margin-left: -1px;
vertical-align: middle;
cursor: pointer;
color: #6d6d6d;
}
.text-collapsible.opened .a,
.text-collapsible.opened > .material-icons.open-icon {
display: none;
}
.text-collapsible.closed .b,
.text-collapsible.closed > .material-icons.close-icon {
display: none;
}
// Helpers
......
<span class="text-collapsible opened">
<span class="a">
{% include template with item=qs.first %} –
{% include template with item=qs.last %}
</span>
<i class="material-icons open-icon" title="Show more">add_circle_outline</i>
<span class="b">
{% for item in qs %}
{% include template with item=item %}
{% endfor %}
</span>
<i class="material-icons close-icon" title="Show less">remove_circle_outline</i>
</span>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment