changeset 1043:91f65b9cc2fb

Uncheck favorites if no favorite entries exist.
author Raimund Renkert <raimund.renkert@intevation.de>
date Thu, 25 Feb 2016 10:38:13 +0100
parents 16c0c6946ae9
children 8e579acfe0b1
files app/controller/Filter.js
diffstat 1 files changed, 8 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/app/controller/Filter.js	Thu Feb 25 10:36:38 2016 +0100
+++ b/app/controller/Filter.js	Thu Feb 25 10:38:13 2016 +0100
@@ -86,11 +86,12 @@
         var filters = element.up('panel[name=main]').down('panel[name=filtervariables]');
         var filterValues = element.up('panel[name=main]').down('panel[name=filtervalues]');
 
+        var desc = element.up('fieldset').down('displayfield[name=description]');
         if (!record[0]) {
+            desc.setValue('');
             return;
         }
         // Set "Filter Auswahl" Description
-        var desc = element.up('fieldset').down('displayfield[name=description]');
         desc.setValue(record[0].data.description);
 
         this.displayFields = record[0].data.results;
@@ -452,6 +453,12 @@
                     return true;
                 }
             });
+            if (entries.getCount() === 0) {
+                fav.setValue(false);
+                entries = store.queryBy(function() {
+                    return true;
+                });
+            }
         }
         else {
             entries = store.queryBy(function() {

http://lada.wald.intevation.org