Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
dwt committed Oct 2, 2018
1 parent ad6d4df commit 695debd
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/zmi/styles/resources/zmi_base.js
Expand Up @@ -136,15 +136,16 @@ function addItem( elm, base_url ) {

// [2] GUI FIX: Add Minimal Style Patches to Ancient Zope Forms
function fix_ancient_gui() {
// WRAP FORM ELEMENT with fluid-container (if missing)
if ( 0 === $('main').length ) {
$('body>form,body>textarea,body>table,body>h2,body>p').wrapAll('<main class="container-fluid zmi-patch"></main>');
// ADD BOOTSTRAP CLASSES
$('input[type="text"], input[type="file"], textarea, select').addClass('form-control zmi-patch');
$('input[type="submit"]').addClass('btn btn-primary zmi-patch');
$('textarea[name*=":text"]').addClass('zmi-code');
$('table').addClass('table zmi-patch');
if ( 0 !== $('main').length ) {
return;
}
// WRAP FORM ELEMENT with fluid-container (if missing)
$('body>form,body>textarea,body>table,body>h2,body>p').wrapAll('<main class="container-fluid zmi-patch"></main>');
// ADD BOOTSTRAP CLASSES
$('input[type="text"], input[type="file"], textarea, select').addClass('form-control zmi-patch');
$('input[type="submit"]').addClass('btn btn-primary zmi-patch');
$('textarea[name*=":text"]').addClass('zmi-code');
$('table').addClass('table zmi-patch');
}

// [3] GUI FIX FOR MODAL DIALOG: Add Minimal Style Patches to Ancient Zope Forms
Expand Down

0 comments on commit 695debd

Please sign in to comment.