From 2a76514b9c5bbc8c1254ed1416f000d4ed16f109 Mon Sep 17 00:00:00 2001 From: Jan Schneider Date: Thu, 18 Feb 2010 14:01:40 +0100 Subject: [PATCH] Hide pickers when closing dialogs. --- horde/js/colorpicker.js | 4 ++++ kronolith/js/kronolith.js | 17 ++++++++++++++++- kronolith/templates/chunks/calendar.php | 2 +- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/horde/js/colorpicker.js b/horde/js/colorpicker.js index ce417c514..1d255a081 100644 --- a/horde/js/colorpicker.js +++ b/horde/js/colorpicker.js @@ -138,6 +138,10 @@ var ColorPicker = Class.create({ removeEvents: function() { + if (!this.listeners) { + return; + } + this.listeners.each(function(l) { $(l[0]).stopObserving(l[1], l[2]); }); diff --git a/kronolith/js/kronolith.js b/kronolith/js/kronolith.js index 8e0710ecc..a9097c51b 100644 --- a/kronolith/js/kronolith.js +++ b/kronolith/js/kronolith.js @@ -16,7 +16,7 @@ var frames = { horde_main: true }, KronolithCore = { // Vars used and defaulting to null/false: // DMenu, Growler, inAjaxCallback, is_logout, - // daySizes, viewLoading, freeBusy + // daySizes, viewLoading, freeBusy, colorPicker view: '', ecache: $H(), @@ -2840,6 +2840,10 @@ KronolithCore = { return; case 'kronolithFormCancel': + Horde_Calendar.hideCal(); + if (this.colorPicker) { + this.colorPicker.hide(); + } this._closeRedBox(); this.resetMap(); window.history.back(); @@ -2878,6 +2882,17 @@ KronolithCore = { this.go('event:' + date); e.stop(); return; + + case 'kronolithColorPicker': + var input = elt.previous(); + this.colorPicker = new ColorPicker({ + color: $F(input), + offsetParent: elt, + update: [[input, 'value'], + [input, 'background']] + }); + e.stop(); + return; } if (elt.hasClassName('kronolithEvent')) { diff --git a/kronolith/templates/chunks/calendar.php b/kronolith/templates/chunks/calendar.php index 5c69cfc7f..20cc2ebcd 100644 --- a/kronolith/templates/chunks/calendar.php +++ b/kronolith/templates/chunks/calendar.php @@ -14,7 +14,7 @@
-- 2.11.0