From 1e7aa75d18e34b0733d49a3af689be0f3d73b83c Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Wed, 24 Oct 2012 04:05:22 -0400
Subject: [PATCH] Remove leftover code

---
 plugins/jqueryui/jqueryui.php |   19 +++++++++++++++++--
 1 files changed, 17 insertions(+), 2 deletions(-)

diff --git a/plugins/jqueryui/jqueryui.php b/plugins/jqueryui/jqueryui.php
index 69b9ca1..f96366e 100644
--- a/plugins/jqueryui/jqueryui.php
+++ b/plugins/jqueryui/jqueryui.php
@@ -24,7 +24,7 @@
         $this->include_script("js/jquery-ui-$version.custom.min.js");
 
         // include UI stylesheet
-        $skin = $rcmail->config->get('skin', 'default');
+        $skin = $rcmail->config->get('skin');
         $ui_map = $rcmail->config->get('jquery_ui_skin_map', array());
         $ui_theme = $ui_map[$skin] ? $ui_map[$skin] : $skin;
 
@@ -32,7 +32,22 @@
             $this->include_stylesheet("themes/$ui_theme/jquery-ui-$version.custom.css");
         }
         else {
-            $this->include_stylesheet("themes/default/jquery-ui-$version.custom.css");
+            $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

--
Gitblit v1.9.1