[FIX] use _.isEmpty instead of Object.keys
authorGéry Debongnie <ged@odoo.com>
Fri, 30 May 2014 09:33:56 +0000 (11:33 +0200)
committerGéry Debongnie <ged@odoo.com>
Fri, 30 May 2014 09:33:56 +0000 (11:33 +0200)
Object.keys is not supported by all browsers (*cough* IE *cough*).
Also, bonus, isEmpty is more readable and more 'semantic'

addons/web/static/src/js/search.js

index a98b42d..bce4fc6 100644 (file)
@@ -1819,7 +1819,7 @@ instance.web.search.CustomReports = instance.web.search.Input.extend({
                         $filter.remove();
                         delete self.$filters[key];
                         delete self.filters[key];
-                        if (!Object.keys(self.filters).length) {
+                        if (_.isEmpty(self.filters)) {
                             self.hide();
                         }
                     });