Also fix dialog position 'right'

pull/18/head
Thomas Bruederli 13 years ago
parent ea32756bc5
commit edd2565bf3

@ -39,8 +39,13 @@ class jqueryui extends rcube_plugin
// patch dialog position function in order to fully fit the close button into the window // 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, { $rcmail->output->add_script("jQuery.extend(jQuery.ui.dialog.prototype.options.position, {
using: function(pos) { using: function(pos) {
var topOffset = jQuery(this).css(pos).offset().top - 12; var me = jQuery(this),
if (topOffset < 0) jQuery(this).css('top', pos.top - topOffset); 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'); });", 'foot');
} }

Loading…
Cancel
Save