Fix a few search-related bugs.
authorJan Schneider <jan@horde.org>
Mon, 15 Mar 2010 18:09:22 +0000 (19:09 +0100)
committerJan Schneider <jan@horde.org>
Mon, 15 Mar 2010 18:09:22 +0000 (19:09 +0100)
kronolith/js/kronolith.js

index 51e2286..b7dd6f6 100644 (file)
@@ -290,7 +290,8 @@ KronolithCore = {
                     date = this.date;
                 }
 
-                if (this.view == loc && date.getYear() == this.date.getYear() &&
+                if (this.view != 'agenda' &&
+                    this.view == loc && date.getYear() == this.date.getYear() &&
                     ((loc == 'year') ||
                      (loc == 'month' && date.getMonth() == this.date.getMonth()) ||
                      (loc == 'week' && date.getRealWeek() == this.date.getRealWeek()) ||
@@ -354,7 +355,7 @@ KronolithCore = {
         case 'search':
             var cals = [], term = locParts[0],
                 query = Object.toJSON({ title: term });
-            this.closeView();
+            this.closeView('agenda');
             this.updateView(null, 'search', term);
             $H(Kronolith.conf.calendars).each(function(type) {
                 $H(type.value).each(function(calendar) {
@@ -592,8 +593,7 @@ KronolithCore = {
                 $('kronolithAgendaDate')
                     .update(this.setTitle(Kronolith.text.agenda + ' ' + dates[0].toString('d') + ' - ' + dates[1].toString('d')));
             } else {
-                $('kronolithViewAgenda')
-                    .down('caption span')
+                $('kronolithAgendaDate')
                     .update(this.setTitle(Kronolith.text.searching.interpolate({ term: data })));
             }
 
@@ -3367,6 +3367,7 @@ console.log(x);
 
             case 'kronolithSearchButton':
                 this.go('search:' + $F('kronolithSearchTerm'))
+                e.stop();
                 break;
 
             case 'kronolithNotifications':