From ca2b56979cab00039546b2c728b28b265c89f3d8 Mon Sep 17 00:00:00 2001 From: Hadi Nategh Date: Mon, 10 Nov 2014 12:54:31 +0000 Subject: [PATCH] * Mail: Fix mail display and compose open in full height -commits r49335, r49336, r49339, and r49340. --- mail/inc/class.mail_hooks.inc.php | 11 ++++------- mail/js/app.js | 16 +--------------- mail/templates/default/app.css | 2 +- mail/templates/pixelegg/app.css | 6 +++--- mail/templates/pixelegg/app.less | 4 ++-- phpgwapi/js/jsapi/egw.js | 4 ++++ phpgwapi/js/jsapi/egw_open.js | 10 +++++++++- 7 files changed, 24 insertions(+), 29 deletions(-) diff --git a/mail/inc/class.mail_hooks.inc.php b/mail/inc/class.mail_hooks.inc.php index fe679ae04d..873461b337 100644 --- a/mail/inc/class.mail_hooks.inc.php +++ b/mail/inc/class.mail_hooks.inc.php @@ -77,26 +77,23 @@ class mail_hooks 'menuaction' => 'mail.mail_ui.displayMessage', ), 'view_id' => 'id', - 'view_popup' => '870xegw_getWindowOuterHeight()', - //'view_popup' => '870x800', + 'view_popup' => '870xavailHeight', 'view_list' => 'mail.mail_ui.index', 'add' => array( 'menuaction' => 'mail.mail_compose.compose', ), - //'add_popup' => '870xegw_getWindowOuterHeight()', - 'add_popup' => '870x800', + 'add_popup' => '870xavailHeight', 'edit' => array( 'menuaction' => 'mail.mail_compose.compose', ), 'edit_id' => 'id', - //'edit_popup' => '870xegw_getWindowOuterHeight()', - 'edit_popup' => '870x800', + 'edit_popup' => '870xavailHeight', // register mail as handler for .eml files 'mime' => array( 'message/rfc822' => array( 'menuaction' => 'mail.mail_ui.importMessageFromVFS2DraftAndDisplay', 'mime_url' => 'formData[file]', - 'mime_popup' => '870xegw_getWindowOuterHeight()', + 'mime_popup' => '870xavailHeight', ), ), 'entry' => 'Mail', diff --git a/mail/js/app.js b/mail/js/app.js index e6a6874d2a..e70f4f9e33 100644 --- a/mail/js/app.js +++ b/mail/js/app.js @@ -164,23 +164,9 @@ app.classes.mail = AppJS.extend( } break; case 'mail.display': - var subject = this.et2.getWidgetById('mail_displaysubject'); - var body = this.et2.getWidgetById('mailDisplayBodySrc'); this.mail_isMainWindow = false; this.mail_display(); - body.node.parentNode.style.top=subject.node.offsetTop+40+'px'; - var app_registry = egw.link_get_registry('mail'); - var w=870; - if (typeof app_registry['view'] != 'undefined' && typeof app_registry['view_popup'] != 'undefined' ) - { - var w_h =app_registry['view_popup'].split('x'); - if (w_h[1] == 'egw_getWindowOuterHeight()') - { - w_h[1] = (screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight()); - } - } - window.resizeTo((w_h[0]?w_h[0]:870),(w_h[1]?w_h[1]:(screen.availHeight>egw_getWindowOuterHeight()?screen.availHeight:egw_getWindowOuterHeight()))); - + // Register attachments for drag this.register_for_drag( this.et2.getArrayMgr("content").getEntry('mail_id'), diff --git a/mail/templates/default/app.css b/mail/templates/default/app.css index 16a9569191..08f9d7cd24 100644 --- a/mail/templates/default/app.css +++ b/mail/templates/default/app.css @@ -521,7 +521,7 @@ div.mail-compose_fileselector { } #mail-display, #mail-compose { - min-height: 500px; + min-height: 768px; } .mailDisplayContainer, .mailDisplayAttachments { display: block; diff --git a/mail/templates/pixelegg/app.css b/mail/templates/pixelegg/app.css index fedea2b17d..ef673407f2 100755 --- a/mail/templates/pixelegg/app.css +++ b/mail/templates/pixelegg/app.css @@ -521,7 +521,7 @@ div.mail-compose_fileselector { } #mail-display, #mail-compose { - min-height: 500px; + min-height: 768px; } .mailDisplayContainer, .mailDisplayAttachments { @@ -976,7 +976,7 @@ div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubje } #mail-compose { width: 870px; - min-height: 500px; + min-height: 768px; padding: 5px; /*// ###############################################################################*/ /*// Mail Header*/ @@ -1470,7 +1470,7 @@ div#mail-index div#mail-index_mailPreview div#mail-index_mailPreviewHeadersSubje */ #mail-display { width: 870px; - min-height: 500px; + min-height: 768px; padding: 5px; /*.mailDisplayHeaderSection{*/ /*top: 0;*/ diff --git a/mail/templates/pixelegg/app.less b/mail/templates/pixelegg/app.less index 3507775d14..e3337135b2 100755 --- a/mail/templates/pixelegg/app.less +++ b/mail/templates/pixelegg/app.less @@ -332,7 +332,7 @@ div#mail-index{ #mail-compose{ // gesamtbreite width: 870px; - min-height: 500px; + min-height: 768px; padding: 5px; @@ -667,7 +667,7 @@ div#mail-index{ #mail-display{ // gesamtbreite width: 870px; - min-height: 500px; + min-height: 768px; padding: 5px; /*.mailDisplayHeaderSection{*/ diff --git a/phpgwapi/js/jsapi/egw.js b/phpgwapi/js/jsapi/egw.js index d0576aa572..6cc1dc02cf 100644 --- a/phpgwapi/js/jsapi/egw.js +++ b/phpgwapi/js/jsapi/egw.js @@ -235,6 +235,10 @@ // to take padding/margin into account var delta_width = w.width - ($et2.outerWidth(true) + ($main_div.outerWidth(true) - $main_div.width())); var delta_height = w.height - ($et2.outerHeight(true) + ($main_div.outerHeight(true) - $main_div.height())); + if (delta_height && egw_getWindowOuterHeight() >= egw.availHeight()) + { + delta_height = 0; + } if(delta_width != 0 || delta_height != 0) { window.resizeTo(egw_getWindowOuterWidth() - delta_width,egw_getWindowOuterHeight() - delta_height); diff --git a/phpgwapi/js/jsapi/egw_open.js b/phpgwapi/js/jsapi/egw_open.js index 9ddc90b824..22202c2e9f 100644 --- a/phpgwapi/js/jsapi/egw_open.js +++ b/phpgwapi/js/jsapi/egw_open.js @@ -279,7 +279,7 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) if (_popup) { var w_h = _popup.split('x'); - if (w_h[1] == 'egw_getWindowOuterHeight()') w_h[1] = egw_getWindowOuterHeight(); + if (w_h[1] == 'availHeight') w_h[1] = this.availHeight(); var popup_window = _wnd.egw_openWindowCentered2(url, _target || '_blank', w_h[0], w_h[1], false, _target_app, true); // Remember which windows are open @@ -303,6 +303,14 @@ egw.extend('open', egw.MODULE_WND_LOCAL, function(_egw, _wnd) } }, + /** + * Get available height of screen + */ + availHeight: function() + { + return screen.availHeight < screen.height ? screen.availHeight : screen.height - 100; + }, + /** * Use frameworks (framed template) link handler to open a url *