Fix resetting search field.
authorJan Schneider <jan@horde.org>
Wed, 8 Dec 2010 14:49:45 +0000 (15:49 +0100)
committerJan Schneider <jan@horde.org>
Wed, 8 Dec 2010 14:49:45 +0000 (15:49 +0100)
kronolith/js/kronolith.js

index 4925c0b..cb8de46 100644 (file)
@@ -321,13 +321,16 @@ KronolithCore = {
             this.redirect(fullloc, true);
             return;
         }
-
         if (this.openLocation == fullloc) {
             return;
         }
 
         this.viewLoading.push([ fullloc, data ]);
 
+        if (loc != 'search') {
+            $('kronolithSearchTerm').setValue($('kronolithSearchTerm').readAttribute('default'));
+        }
+
         switch (loc) {
         case 'day':
         case 'week':
@@ -790,7 +793,6 @@ KronolithCore = {
             }
         });
         if (this.view && this.view != loc) {
-            $('kronolithSearchTerm').setValue($('kronolithSearchTerm').readAttribute('default'));
             $('kronolithView' + this.view.capitalize()).fade({
                 duration: this.effectDur,
                 queue: 'end'