Skip to content

Commit

Permalink
Toggle long error alerts
Browse files Browse the repository at this point in the history
  • Loading branch information
Dr. Frank Hoffmann authored and Dr. Frank Hoffmann committed May 2, 2019
1 parent c160d64 commit 28cc285
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
12 changes: 11 additions & 1 deletion src/zmi/styles/resources/zmi_base.css
Expand Up @@ -27,7 +27,17 @@ body.zmi {
main.container-fluid .alert {
margin: 0 0 1rem;
}

main.container-fluid .alert.alert-danger pre {
margin:0;
max-height:4em;
overflow-y:scroll;
overflow-x:hidden;
cursor:pointer;
}
main.container-fluid .alert.alert-danger pre.fullheight {
max-height: fit-content;
overflow-y: hidden;
}
/* BUTTONS / CONTROLS */

a {
Expand Down
7 changes: 6 additions & 1 deletion src/zmi/styles/resources/zmi_base.js
Expand Up @@ -86,7 +86,7 @@ function fix_ancient_gui() {
// [3] GUI FIX FOR MODAL DIALOG: Add Minimal Style Patches to Ancient Zope Forms
function fix_ancient_modal_gui() {
if ( 0 === $('.modal-body main').length ) {
$('.modal-body>form,.modal-body>table,.modal-body>h2,.modal-body>h3,.modal-body>p,.modal-body>i.zmi-help-icon').wrapAll('<main class="container-fluid zmi-patch"></main>');
$('.modal-body>form,.modal-body>table,.modal-body>h2,.modal-body>h3,.modal-body>p,.modal-body>i.zmi-help-icon').wrapAll('<main class="container-fluid zmi-patch"></main>');
// ADD BOOTSTRAP CLASSES
$('.modal-body input[type="text"],.modal-body input[type="file"],.modal-body textarea,.modal-body select').addClass('form-control zmi-patch');
$('.modal-body input[type="submit"]').addClass('btn btn-primary zmi-patch');
Expand Down Expand Up @@ -217,5 +217,10 @@ $(function() {
if (!window.matchMedia || (window.matchMedia("(max-width: 767px)").matches)) {
$('.zmi header.navbar li.zmi-authenticated_user').tooltip({'placement':'bottom'});
}

// EXPAND LONG ERROR ALERTS
$('main.container-fluid .alert.alert-danger pre').click( function() {
$(this).toggleClass('fullheight');
})

});

0 comments on commit 28cc285

Please sign in to comment.