From d0f60f9e9301373b1914d13181c6ea228f1a823d Mon Sep 17 00:00:00 2001 From: Francis Lachapelle Date: Thu, 6 Aug 2009 21:22:11 +0000 Subject: [PATCH] Improvments to email editor Monotone-Parent: f9cf3e34986ed3ca9506b2146ff9c4177d2eb7e6 Monotone-Revision: 8ba93fdae75ee545af159a1b88dfb6faccbe7bc2 Monotone-Author: flachapelle@inverse.ca Monotone-Date: 2009-08-06T21:22:11 Monotone-Branch: ca.inverse.sogo --- UI/WebServerResources/UIxMailEditor.css | 15 +++++++++------ UI/WebServerResources/UIxMailEditor.js | 22 +++++++++++----------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/UI/WebServerResources/UIxMailEditor.css b/UI/WebServerResources/UIxMailEditor.css index c22ddea34..01c982705 100644 --- a/UI/WebServerResources/UIxMailEditor.css +++ b/UI/WebServerResources/UIxMailEditor.css @@ -151,10 +151,13 @@ UL#attachments LI UL#attachments LI IMG { vertical-align: bottom; } -#pageContent TEXTAREA +#pageContent TEXTAREA, +#cke_text { position: absolute; - left: 0em; - right: 0em; - bottom: 0em; - top: 999em; - width: 99%; } + left: 0; + right: 0; + bottom: 0; + /*top: 999em;*/ } + +#pageContent TEXTAREA +{ width: 99%; } diff --git a/UI/WebServerResources/UIxMailEditor.js b/UI/WebServerResources/UIxMailEditor.js index 0f626f9e0..48636496a 100644 --- a/UI/WebServerResources/UIxMailEditor.js +++ b/UI/WebServerResources/UIxMailEditor.js @@ -676,11 +676,12 @@ function onWindowResize(event) { var attachmentsarea = $("attachmentsArea"); var attachmentswidth = 0; if (attachmentsarea.style.display) { + // Resize attachments list attachmentswidth = attachmentsarea.getWidth(); fromfield = $(document).getElementsByClassName('headerField', headerarea)[0]; var height = headerarea.getHeight() - fromfield.getHeight() - 10; if (Prototype.Browser.IE) - $("attachments").setStyle({ height: (height-9) + 'px' }); + $("attachments").setStyle({ height: (height - 13) + 'px' }); else $("attachments").setStyle({ height: height + 'px' }); } @@ -706,23 +707,22 @@ function onWindowResize(event) { if (composeMode == "html") { var editor = $('cke_text'); if (editor == null) { - setTimeout ('onWindowResize ()', 100); + onWindowResize.defer(); return; } + var ck_top = $("cke_top_text"); + var ck_bottom = $("cke_bottom_text"); var content = $("cke_contents_text"); - var height = Math.floor(window.height() - editor.offsetTop); - - content.height = (height-60) + "px"; - content.style.height = (height-60) + "px"; - + var top = hr.offsetTop; + var height = Math.floor(window.height() - top - ck_top.getHeight() - ck_bottom.getHeight()); + if (Prototype.Browser.IE) { editor.style.width = ''; editor.style.height = ''; - height += 3; - } - else { - content.setStyle({ 'top': hr.offsetTop + 'px' }); } + + editor.setStyle({ top: (top + 2) + 'px' }); + content.setStyle({ height: height + 'px' }); } else textarea.rows = Math.floor((window.height() - textarea.offsetTop) / rowheight);