[Lada-commits] [PATCH 2 of 5] Uncheck favorites if no favorite entries exist

Wald Commits scm-commit at wald.intevation.org
Fri Feb 26 09:41:47 CET 2016


# HG changeset patch
# User Raimund Renkert <raimund.renkert at intevation.de>
# Date 1456393093 -3600
# Node ID 91f65b9cc2fbcfb56161d9a91b5feb052a7b2d9c
# Parent  16c0c6946ae97cfad408534f2f5377077ab10352
Uncheck favorites if no favorite entries exist.

diff -r 16c0c6946ae9 -r 91f65b9cc2fb app/controller/Filter.js
--- 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() {


More information about the Lada-commits mailing list