From: Jan Schneider Date: Fri, 13 Mar 2009 11:26:22 +0000 (+0100) Subject: Show spinner while retrieving events. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=034441f4fb9d3e6375ccb7c0a8d1c3b3fe6acc4b;p=horde.git Show spinner while retrieving events. --- diff --git a/kronolith/ajax.php b/kronolith/ajax.php index 6af4536f1..fc1f655e6 100644 --- a/kronolith/ajax.php +++ b/kronolith/ajax.php @@ -63,7 +63,7 @@ case 'ListEvents': if (!array_key_exists($calendar, Kronolith::listCalendars(false, PERMS_READ))) { $notification->push(_("Permission Denied"), 'horde.error'); - $result = false; + $result = true; break 2; } $driver = ''; @@ -87,7 +87,7 @@ case 'ListEvents': $events = $kronolith_driver->listEvents($start, $end, true, false, true); if (is_a($events, 'PEAR_Error')) { $notification->push($events, 'horde.error'); - $result = false; + $result = true; } else { $result = new stdClass; $result->cal = $cal; diff --git a/kronolith/js/src/kronolith.js b/kronolith/js/src/kronolith.js index 6f7319dbf..6e654cf0d 100644 --- a/kronolith/js/src/kronolith.js +++ b/kronolith/js/src/kronolith.js @@ -23,6 +23,7 @@ KronolithCore = { ecache: $H(), efifo: {}, eventsLoading: $H(), + loading: 0, date: new Date(), doActionOpts: { @@ -516,6 +517,8 @@ KronolithCore = { calendars.each(function(cal) { var calendar = cal.join('|'); this.eventsLoading[calendar] = start + end; + this.loading++; + $('kronolithLoading').show(); this.doAction('ListEvents', { start: start, end: end, cal: calendar, view: view }, callback.bind(this)); }, this); }, @@ -529,6 +532,12 @@ KronolithCore = { { var div; + // Hide spinner. + this.loading--; + if (!this.loading) { + $('kronolithLoading').hide(); + } + // Check if this is the still the result of the most current request. if (r.response.view != this.view || r.response.sig != this.eventsLoading[r.response.cal]) { diff --git a/kronolith/templates/index/index.inc b/kronolith/templates/index/index.inc index 54a25357d..f3dc11526 100644 --- a/kronolith/templates/index/index.inc +++ b/kronolith/templates/index/index.inc @@ -192,6 +192,7 @@
+ getImageDir('horde')); require dirname(__FILE__) . '/month.inc'; diff --git a/kronolith/themes/screen.css b/kronolith/themes/screen.css index 666be220a..7701b76ee 100644 --- a/kronolith/themes/screen.css +++ b/kronolith/themes/screen.css @@ -482,6 +482,22 @@ body.kronolithAjax { display: none; } +/* Loading spinner */ +#kronolithLoading { + position: absolute; + z-index: 1000; + background: transparent url("graphics/loading.gif") no-repeat center; + padding: 2px; + width: 16px; + height: 17px; + /* Take values from .kronolithView */ + top: 50px; + left: 175px; + margin-top: 5px; + /* Take values from .kronolithRow */ + border: 1px #c0c0c0 solid; +} + /* User data and options */ #kronolithUser { float: right;