Просмотр исходного кода

(snapshot) restrict saving original url for local snapshot

Mitsuhiro Tanda 9 лет назад
Родитель
Сommit
cc519adcfc
1 измененных файлов с 5 добавлено и 2 удалено
  1. 5 2
      public/app/features/dashboard/shareSnapshotCtrl.js

+ 5 - 2
public/app/features/dashboard/shareSnapshotCtrl.js

@@ -41,10 +41,13 @@ function (angular, _) {
 
     $scope.createSnapshot = function(external) {
       $scope.dashboard.snapshot = {
-        timestamp: new Date(),
-        originalUrl: $location.absUrl()
+        timestamp: new Date()
       };
 
+      if (!external) {
+        $scope.dashboard.snapshot.originalUrl = $location.absUrl();
+      }
+
       $scope.loading = true;
       $scope.snapshot.external = external;