From 4b09fb6ce6564e901da0f9e9353af5224c8a6014 Mon Sep 17 00:00:00 2001
From: alecpl <alec@alec.pl>
Date: Wed, 12 Oct 2011 07:54:25 -0400
Subject: [PATCH] - Add possibility to auto-register menu objects in show_popup()

---
 skins/default/functions.js |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/skins/default/functions.js b/skins/default/functions.js
index 32c0a73..6f22bb6 100644
--- a/skins/default/functions.js
+++ b/skins/default/functions.js
@@ -108,8 +108,13 @@
 
 rcube_mail_ui.prototype = {
 
-show_popup: function(popup, show)
+show_popup: function(popup, show, config)
 {
+  var obj;
+  // auto-register menu object
+  if (!this.popups[popup] && (obj = $('#'+popup)) && obj.length)
+    this.popups[popup] = $.extend(config, {id: popup, obj: obj});
+
   if (typeof this[popup] == 'function')
     return this[popup](show);
   else
@@ -141,7 +146,7 @@
   }
 
   obj[show?'show':'hide']();
-  
+
   if (bw.ie6 && this.popups[popup].overlap) {
     $('select').css('visibility', show?'hidden':'inherit');
     $('select', obj).css('visibility', 'inherit');

--
Gitblit v1.9.1