From ce2b445efdce63cddaef9ad8dae7bf0943b24613 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Thu, 13 Apr 2017 20:01:02 +0200 Subject: [PATCH] Make mail compose headers more pretty with some Bootstrap styles --- skins/elastic/styles/styles.less | 3 +- skins/elastic/styles/widgets/forms.less | 19 ++++ skins/elastic/templates/compose.html | 127 +++++++++--------------- skins/elastic/ui.js | 8 ++ 4 files changed, 78 insertions(+), 79 deletions(-) diff --git a/skins/elastic/styles/styles.less b/skins/elastic/styles/styles.less index 42ca407bc..a92deb8e2 100644 --- a/skins/elastic/styles/styles.less +++ b/skins/elastic/styles/styles.less @@ -123,8 +123,9 @@ button, input, select, textarea { /*** Common UI elements ***/ +.hidden, .voice { - display: none; + display: none !important; } #rcmdraglayer { diff --git a/skins/elastic/styles/widgets/forms.less b/skins/elastic/styles/widgets/forms.less index 9d7efc5ed..524c10288 100644 --- a/skins/elastic/styles/widgets/forms.less +++ b/skins/elastic/styles/widgets/forms.less @@ -25,6 +25,10 @@ input.smart-upload { margin-right: 0; /* without these the form is too wide causing horizontal scrollbar appearence */ margin-left: 0; } + .row .input-group { + padding-right: 0; /* without these e.g. inputs in compose screen are not aligned properly */ + padding-left: 0; + } } .formbuttons { @@ -34,6 +38,7 @@ input.smart-upload { /* Some common icons for "iconized inputs" */ .input-group-addon.icon { + text-decoration: none; &:before { &:extend(.font-icon-class); @@ -49,6 +54,19 @@ input.smart-upload { &.host:before { content: @fa-var-home; } + &.cancel:before { + content: @fa-var-close; + } + &.edit:before { + content: @fa-var-pencil; + } + &.add:before { + content: @fa-var-plus; + } + + .inner { + display: none; + } } @@ -58,6 +76,7 @@ td.editfield { width: 99%; /* TODO */ } /*** Smart recipient input field ***/ .recipient-input { + display: block !important; /* overwrites Bootstrap */ min-height: 2.4em; /* padding: 0.2em 0.5em; */ diff --git a/skins/elastic/templates/compose.html b/skins/elastic/templates/compose.html index a170d27bc..9116d8bea 100644 --- a/skins/elastic/templates/compose.html +++ b/skins/elastic/templates/compose.html @@ -84,83 +84,54 @@

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - -
- - - - - -
- - - -
+
+
+ + +
+
+ + +
+ + + + +
+ + +
+
@@ -195,7 +166,7 @@
- +

diff --git a/skins/elastic/ui.js b/skins/elastic/ui.js index 64e836b7c..ded93e3be 100644 --- a/skins/elastic/ui.js +++ b/skins/elastic/ui.js @@ -146,6 +146,14 @@ function rcube_elastic_ui() } $('[data-recipient-input]').each(function() { recipient_input(this); }); + + // Show input elements with non-empty value + // These event handlers need to be registered before rcmail 'init' event + $('#_cc, #_bcc, #_replyto, #_followupto', $('.compose-headers')).each(function() { + $(this).on('change', function() { + $('#compose' + $(this).attr('id'))[this.value ? 'removeClass' : 'addClass']('hidden'); + }); + }); }; /**