Skip to content

Commit

Permalink
Alert box: added chevron icon for expanding box
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Frank Hoffmann authored and Dr. Frank Hoffmann committed May 3, 2019
1 parent 0001f7e commit 49decbf
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 7 deletions.
20 changes: 16 additions & 4 deletions src/zmi/styles/resources/zmi_base.css
Expand Up @@ -30,14 +30,26 @@ main.container-fluid .alert {
main.container-fluid .alert pre {
margin:0;
max-height:4em;
overflow-y:scroll;
overflow-x:hidden;
overflow:hidden;
cursor:pointer;
}
main.container-fluid .alert pre.fullheight {
main.container-fluid .alert pre.alert_xl:after {
content: "\f078";
position:absolute;
display:block;
white-space:normal;
bottom: .5em;
right: 1em;
font-family: fontawesome;
opacity: .5;
}
main.container-fluid .alert pre.fullheight.alert_xl {
max-height: fit-content;
overflow-y: hidden;
}
main.container-fluid .alert pre.fullheight.alert_xl:after {
content: "\f077";
}

/* BUTTONS / CONTROLS */

a {
Expand Down
9 changes: 6 additions & 3 deletions src/zmi/styles/resources/zmi_base.js
Expand Up @@ -219,8 +219,11 @@ $(function() {
}

// EXPAND LONG ERROR ALERTS
$('main.container-fluid .alert pre').click( function() {
$(this).toggleClass('fullheight');
})
if ($('main.container-fluid .alert pre').text().split(/\n/).length > 2) {
$('main.container-fluid .alert pre').addClass('alert_xl');
$('main.container-fluid .alert pre').click( function() {
$(this).toggleClass('fullheight');
})
}

});

0 comments on commit 49decbf

Please sign in to comment.