From b542f8800e0d093afedf51c4789d901b454e4144 Mon Sep 17 00:00:00 2001
From: Aleksander Machniak <alec@alec.pl>
Date: Fri, 26 Apr 2013 05:43:21 -0400
Subject: [PATCH] Fix exit code on bootsrap errors in CLI mode (#1489044)

---
 plugins/jqueryui/jqueryui.php |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/plugins/jqueryui/jqueryui.php b/plugins/jqueryui/jqueryui.php
index 5a0cfbd..db640d1 100644
--- a/plugins/jqueryui/jqueryui.php
+++ b/plugins/jqueryui/jqueryui.php
@@ -5,7 +5,7 @@
  *
  * Provide the jQuery UI library with according themes.
  *
- * @version 1.8.18
+ * @version 1.9.1
  * @author Cor Bosman <roundcube@wa.ter.net>
  * @author Thomas Bruederli <roundcube@gmail.com>
  */
@@ -15,7 +15,7 @@
 
     public function init()
     {
-        $version = '1.8.18';
+        $version = '1.9.1';
 
         $rcmail = rcmail::get_instance();
         $this->load_config();
@@ -39,8 +39,13 @@
             // 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 = $(this).css(pos).offset().top - 12;
-                    if (topOffset < 0) $(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');
         }

--
Gitblit v1.9.1