From f585d22ce78027ccdf36b3dc9f4629aa998af7ef Mon Sep 17 00:00:00 2001 From: Mitsuhiro Tanda Date: Mon, 16 May 2016 19:18:50 +0900 Subject: [PATCH] (templating) update dynamic dashboard only if variable is changed --- public/app/features/templating/templateValuesSrv.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/public/app/features/templating/templateValuesSrv.js b/public/app/features/templating/templateValuesSrv.js index 0efc5eb468c..bec7545d9c6 100644 --- a/public/app/features/templating/templateValuesSrv.js +++ b/public/app/features/templating/templateValuesSrv.js @@ -27,10 +27,15 @@ function (angular, _, kbn) { .filter(function(variable) { return variable.refresh === 2; }).map(function(variable) { + var previousVariable = angular.copy(variable); return self.updateOptions(variable).then(function () { return self.variableUpdated(variable).then(function () { - dynamicDashboardSrv.update(self.dashboard); - $rootScope.$emit('template-variable-value-updated'); + var updatedVariable = angular.copy(variable); + delete(updatedVariable.$$hashKey); + if (JSON.stringify(previousVariable) !== JSON.stringify(updatedVariable)) { + dynamicDashboardSrv.update(self.dashboard); + $rootScope.$emit('template-variable-value-updated'); + } }); }); });