summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Bruederli <thomas@roundcube.net>2012-08-04 11:44:50 +0200
committerThomas Bruederli <thomas@roundcube.net>2012-08-04 11:45:08 +0200
commitab78cfd0024bf6261e253123ce8332ddb0088640 (patch)
treedb67fcecd16f0368f244675c4ad6fc0fa6f8d4db
parent848e083cb5a776a3b42f57cee98140c718f65de8 (diff)
Also fix dialog position 'right'
-rw-r--r--plugins/jqueryui/jqueryui.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/jqueryui/jqueryui.php b/plugins/jqueryui/jqueryui.php
index b28631ba7..f96366ee8 100644
--- a/plugins/jqueryui/jqueryui.php
+++ b/plugins/jqueryui/jqueryui.php
@@ -39,8 +39,13 @@ class jqueryui extends rcube_plugin
// patch dialog position function in order to fully fit the close button into the window
$rcmail->output->add_script("jQuery.extend(jQuery.ui.dialog.prototype.options.position, {
using: function(pos) {
- var topOffset = jQuery(this).css(pos).offset().top - 12;
- if (topOffset < 0) jQuery(this).css('top', pos.top - topOffset);
+ var me = jQuery(this),
+ offset = me.css(pos).offset(),
+ topOffset = offset.top - 12;
+ if (topOffset < 0)
+ me.css('top', pos.top - topOffset);
+ if (offset.left + me.outerWidth() + 12 > jQuery(window).width())
+ me.css('left', pos.left - 12);
}
});", 'foot');
}