From c23c74062f0c544f7c7ab2b4a5f74d6341b5e0fc Mon Sep 17 00:00:00 2001 From: Davide Alberani Date: Tue, 23 Jan 2018 23:16:04 +0100 Subject: [PATCH] improve filter --- dist/history.html | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/dist/history.html b/dist/history.html index 417258b..f3df40b 100644 --- a/dist/history.html +++ b/dist/history.html @@ -71,13 +71,12 @@ var app = new Vue({ }); }, updateFilter: function() { + if (this.show_empty) { + this.filtered_history = this.history; + return; + } self = this; - this.filtered_history = _.filter(self.history, function(o) { - if (self.show_empty) { - return true; - } - return o.changes; - }); + this.filtered_history = _.filter(self.history, 'changes'); }, toggleShowEmpty: function() { this.updateFilter();