diff --git a/felamimail/inc/class.uidisplay.inc.php b/felamimail/inc/class.uidisplay.inc.php index 19cab33f25..0d61fe6d37 100644 --- a/felamimail/inc/class.uidisplay.inc.php +++ b/felamimail/inc/class.uidisplay.inc.php @@ -837,7 +837,7 @@ } if(($_GET['menuaction'] == 'felamimail.uidisplay.printMessage') || (!empty($printing) && $printing == 1)) { - $GLOBALS['egw']->js->set_onload('javascript:window.print()'); + $GLOBALS['egw']->js->set_onload('javascript:updateTitle();javascript:window.print()'); } if($_GET['menuaction'] == 'felamimail.uidisplay.printMessage' || (!empty($printing) && $printing == 1) || diff --git a/felamimail/js/jscode/composeMessage.js b/felamimail/js/jscode/composeMessage.js index c7812ab0e9..d4b0fc75ee 100644 --- a/felamimail/js/jscode/composeMessage.js +++ b/felamimail/js/jscode/composeMessage.js @@ -41,6 +41,8 @@ function initAll() { //tab.init(); //alert(document.onkeydown); + var titletext = document.getElementById('fm_compose_subject').value; + if (titletext.length>0) updateTitle(titletext); } function addEmail(to,email) diff --git a/felamimail/js/jscode/view_message.js b/felamimail/js/jscode/view_message.js index 2e6ddc262d..95791b820b 100644 --- a/felamimail/js/jscode/view_message.js +++ b/felamimail/js/jscode/view_message.js @@ -36,6 +36,16 @@ function initAll() fm_resizeBodyDIV(); window.onresize = fm_resizeBodyDIV; } + updateTitle(); +} + +function updateTitle() { + var _text = document.getElementById('subjectDATA').firstChild.nodeValue; + if(_text.length>40) { + _text = _text.substring(0,40) + '...'; + } + + document.title = _text; } function toggleHeaderSize() { diff --git a/felamimail/templates/default/view_message.tpl b/felamimail/templates/default/view_message.tpl index 2c42bd7bb4..7789a3820e 100644 --- a/felamimail/templates/default/view_message.tpl +++ b/felamimail/templates/default/view_message.tpl @@ -8,7 +8,7 @@ self.focus(); {navbar}
- {subject_data} + {subject_data}
{header} diff --git a/felamimail/templates/default/view_message_printable.tpl b/felamimail/templates/default/view_message_printable.tpl index 3534be0ac3..212cc13a1d 100644 --- a/felamimail/templates/default/view_message_printable.tpl +++ b/felamimail/templates/default/view_message_printable.tpl @@ -1,4 +1,13 @@ +