Skip to content

Commit

Permalink
[mms] More intelligent sizing of raw message parts opened in a popup …
Browse files Browse the repository at this point in the history
…window.
  • Loading branch information
slusarz committed Oct 2, 2013
1 parent 37ebb5b commit 955dec2
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 1 deletion.
1 change: 1 addition & 0 deletions imp/docs/CHANGES
Expand Up @@ -2,6 +2,7 @@
v6.2.0-git
----------

[mms] More intelligent sizing of raw message parts opened in a popup window.
[mms] Load sent-mail mailbox list on demand in dynamic view.
[mms] Allow configurable access to remote accounts from within a session
(Request #8077).
Expand Down
20 changes: 20 additions & 0 deletions imp/js/imp.js
Expand Up @@ -138,6 +138,26 @@ var IMP_JS = {
}
win.print();
win.close();
},

resizeViewPopup: function(win)
{
var b = win.document.body,
h = 0,
w = 0;

w = b.scrollWidth - b.clientWidth;
if (w) {
w = Math.min(w, screen.availWidth - win.outerWidth - 100);
}
h = b.scrollHeight - b.clientHeight;
if (h) {
h = Math.min(h, screen.availHeight - win.outerHeight - 100);
}

if (w || h) {
win.resizeBy(w, h);
}
}

};
2 changes: 1 addition & 1 deletion imp/lib/Contents.php
Expand Up @@ -967,7 +967,7 @@ public function linkViewJS($mime_part, $actionID, $text,

$url = Horde::popupJs(Horde::url('view.php'), array(
'menu' => true,
'onload' => empty($options['onload']) ? '' : $options['onload'],
'onload' => empty($options['onload']) ? 'IMP_JS.resizeViewPopup' : $options['onload'],
'params' => $this->_urlViewParams($mime_part, $actionID, isset($options['params']) ? $options['params'] : array()),
'urlencode' => true
));
Expand Down
2 changes: 2 additions & 0 deletions imp/package.xml
Expand Up @@ -33,6 +33,8 @@
</stability>
<license uri="http://www.horde.org/licenses/gpl">GPL-2.0</license>
<notes>
* [mms] More intelligent sizing of raw message parts opened in a popup window.

</notes>
<contents>
<dir baseinstalldir="/" name="/">
Expand Down

0 comments on commit 955dec2

Please sign in to comment.