Skip to content
Snippets Groups Projects
Commit 67819811 authored by Sven Kästle's avatar Sven Kästle
Browse files

feat: Implement toggle button functionality

parent 219bc82a
No related branches found
No related tags found
No related merge requests found
......@@ -91,6 +91,7 @@ ol {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}
.annotation-body {
padding: 8px;
......
......@@ -190,6 +190,9 @@ function displayAnnotation(annotation) {
)
.append(
$('<div>').attr('class', 'annotation-header-toggle')
.click(function () {
toggleButtonHandler($(this));
})
.append(
$('<i>').attr('class', 'fas fa-chevron-down')
)
......@@ -333,3 +336,13 @@ function timestampIsToday(timestamp) {
}
}
/**
* Toggle between the toggle button status
*
* @param element the given toggle button
*/
function toggleButtonHandler(element) {
element.parent().siblings(".annotation-body").children("p").toggleClass("overflow-hidden");
element.children("i").toggleClass("fa-chevron-down fa-chevron-up")
}
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