From 8eefbb2158c43b51a8c33e6c480cbe61539b9535 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Mon, 27 Aug 2012 04:16:04 -0400
Subject: [PATCH] Add option to enable HTML editor on forwarding (#1488517)

---
 plugins/jqueryui/jqueryui.php |   15 +++++++++++++++
 1 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/plugins/jqueryui/jqueryui.php b/plugins/jqueryui/jqueryui.php
index f82a149..f96366e 100644
--- a/plugins/jqueryui/jqueryui.php
+++ b/plugins/jqueryui/jqueryui.php
@@ -35,6 +35,21 @@
             $this->include_stylesheet("themes/larry/jquery-ui-$version.custom.css");
         }
 
+        if ($ui_theme == 'larry') {
+            // 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 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');
+        }
+
         // jquery UI localization
         $jquery_ui_i18n = $rcmail->config->get('jquery_ui_i18n', array('datepicker'));
         if (count($jquery_ui_i18n) > 0) {

--
Gitblit v1.9.1