瀏覽代碼

Fixed issue with unsaved changes srv being triggerd by starring / unstarring a dashboard, Fixes #1795

Torkel Ödegaard 10 年之前
父節點
當前提交
a446286869
共有 2 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      public/app/features/dashboard/unsavedChangesSrv.js
  2. 0 0
      public/app/plugins/datasource/sql/plugin.json_

+ 3 - 3
public/app/features/dashboard/unsavedChangesSrv.js

@@ -20,13 +20,13 @@ function(angular, _, config) {
     $rootScope.$on("dashboard-loaded", function(event, newDashboard) {
       // wait for different services to patch the dashboard (missing properties)
       $timeout(function() {
-        self.original = angular.copy(newDashboard);
+        self.original = newDashboard.getSaveModelClone();
         self.current = newDashboard;
       }, 1200);
     });
 
     $rootScope.$on("dashboard-saved", function(event, savedDashboard) {
-      self.original = angular.copy(savedDashboard);
+      self.original = savedDashboard.getSaveModelClone();
       self.current = savedDashboard;
       self.orignalPath = $location.path();
     });
@@ -85,7 +85,7 @@ function(angular, _, config) {
         return false;
       }
 
-      var current = angular.copy(self.current);
+      var current = self.current.getSaveModelClone();
       var original = self.original;
 
       // ignore timespan changes

+ 0 - 0
public/app/plugins/datasource/sql/plugin.json → public/app/plugins/datasource/sql/plugin.json_