From 421ed1e5458ef8b3947ca4cce45eae7804b41f74 Mon Sep 17 00:00:00 2001 From: Aleksander Machniak Date: Mon, 27 Oct 2014 17:51:28 +0100 Subject: Fix compose body area size, so scrollbars aren't truncated, unify padding --- program/js/editor.js | 2 +- program/js/googiespell.js | 12 +++++++----- program/js/tinymce/roundcube/content.css | 4 +--- skins/classic/functions.js | 7 ++++--- skins/classic/googiespell.css | 2 +- skins/larry/googiespell.css | 7 ++----- skins/larry/mail.css | 6 +++--- skins/larry/ui.js | 2 +- 8 files changed, 20 insertions(+), 22 deletions(-) diff --git a/program/js/editor.js b/program/js/editor.js index 0facfd948..26b6927f5 100644 --- a/program/js/editor.js +++ b/program/js/editor.js @@ -40,7 +40,7 @@ function rcube_text_editor(config, id) selector: '#' + ($('#' + id).is('.mce_editor') ? id : 'fake-editor-id'), theme: 'modern', language: config.lang, - content_css: 'program/js/tinymce/roundcube/content.css?v1', + content_css: 'program/js/tinymce/roundcube/content.css?v2', menubar: false, statusbar: false, toolbar_items_size: 'small', diff --git a/program/js/googiespell.js b/program/js/googiespell.js index 707efd165..8c17508dd 100644 --- a/program/js/googiespell.js +++ b/program/js/googiespell.js @@ -312,7 +312,9 @@ this.prepare = function(ignore, no_indicator) this.ignore = ignore; this.hideLangWindow(); - if ($(this.text_area).val() == '' || ignore) { + var area = $(this.text_area); + + if (area.val() == '' || ignore) { if (!this.custom_no_spelling_error) this.flashNoSpellingErrorState(); else @@ -321,7 +323,7 @@ this.prepare = function(ignore, no_indicator) return; } - this.createEditLayer(this.text_area.offsetWidth, this.text_area.offsetHeight); + this.createEditLayer(area.width(), area.height()); this.createErrorWindow(); $('body').append(this.error_window); @@ -331,7 +333,7 @@ this.prepare = function(ignore, no_indicator) if (this.main_controller) $(this.spell_span).unbind('click'); - this.orginal_text = $(this.text_area).val(); + this.orginal_text = area.val(); }; this.parseResult = function(r_text) @@ -674,10 +676,10 @@ this.createEditLayer = function(width, height) { this.edit_layer = document.createElement('div'); $(this.edit_layer).addClass('googie_edit_layer').attr('id', 'googie_edit_layer') - .width('auto').height(height); + .width(width).height(height); if (this.text_area.nodeName.toLowerCase() != 'input' || $(this.text_area).val() == '') { - $(this.edit_layer).css('overflow', 'auto').height(height-4); + $(this.edit_layer).css('overflow', 'auto'); } else { $(this.edit_layer).css('overflow', 'hidden'); } diff --git a/program/js/tinymce/roundcube/content.css b/program/js/tinymce/roundcube/content.css index 67480ab77..0ad246ea0 100644 --- a/program/js/tinymce/roundcube/content.css +++ b/program/js/tinymce/roundcube/content.css @@ -7,9 +7,7 @@ body, td, pre { body { background-color: #FFFFFF; - margin-left: 4px; - margin-right: 4px; - margin-top: 2px; + margin: 4px; } div.pre { diff --git a/skins/classic/functions.js b/skins/classic/functions.js index 2bf1538c4..aaa4f7288 100644 --- a/skins/classic/functions.js +++ b/skins/classic/functions.js @@ -547,12 +547,13 @@ init_compose_form: function() resize_compose_body: function() { var div = $('#compose-div .boxlistcontent'), - w = div.width() - 2, h = div.height(), + w = div.width() - 6, + h = div.height() - 2, x = bw.ie || bw.opera ? 4 : 0; - $('#compose-body_ifr').width(w+3).height(h-2 - $('div.mce-toolbar').height()); + $('#compose-body_ifr').width(w + 6).height(h - 1 - $('div.mce-toolbar').height()); $('#compose-body').width(w-x).height(h); - $('#googie_edit_layer').height(h); + $('#googie_edit_layer').width(w).height(h); }, resize_compose_body_ev: function() diff --git a/skins/classic/googiespell.css b/skins/classic/googiespell.css index b4fab5bdb..fc6b069a1 100644 --- a/skins/classic/googiespell.css +++ b/skins/classic/googiespell.css @@ -9,7 +9,7 @@ .googie_edit_layer { background-color: #ffffff; - padding: 0 4px; + padding: 1px 3px; font-size: 9pt; font-family: monospace; } diff --git a/skins/larry/googiespell.css b/skins/larry/googiespell.css index d2f1cea78..2241ccd58 100644 --- a/skins/larry/googiespell.css +++ b/skins/larry/googiespell.css @@ -8,10 +8,7 @@ } .googie_edit_layer { - position: relative; - top: 1px; - left: 1px; - padding: 8px; + padding: 4px; font-size: 9pt; font-family: monospace; background-color: #fff; @@ -26,7 +23,7 @@ width: 100%; margin: 0; padding: 0; - border-spacing: 0; + border-spacing: 0; } .googie_list td { diff --git a/skins/larry/mail.css b/skins/larry/mail.css index 0f1eaa8a7..9a2fe6974 100644 --- a/skins/larry/mail.css +++ b/skins/larry/mail.css @@ -1305,13 +1305,13 @@ div.message-partheaders .headers-table td.header { width: 99%; border: 0; border-radius: 0 0 0 4px; - padding: 8px 0 8px 8px; + padding: 4px; resize: none; font-family: monospace; font-size: 9pt; outline: none; - box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.2); - -webkit-box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.2); + box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.1); + -webkit-box-shadow: inset 0 0 2px 1px rgba(0,0,0, 0.1); } #composebody:active, diff --git a/skins/larry/ui.js b/skins/larry/ui.js index 5cd216724..c8204b603 100644 --- a/skins/larry/ui.js +++ b/skins/larry/ui.js @@ -502,7 +502,7 @@ function rcube_mail_ui() $('#composebodycontainer > div').width(w+8); $('#composebody_ifr').height(h + 4 - $('div.mce-toolbar').height()); - $('#googie_edit_layer').height(h - 8); + $('#googie_edit_layer').width(w).height(h); // $('#composebodycontainer')[(btns ? 'addClass' : 'removeClass')]('buttons'); // $('#composeformbuttons')[(btns ? 'show' : 'hide')](); -- cgit v1.2.3