From 66d9c4f1afb689eb2a1640561a06cb166e28c062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Mon, 2 Feb 2015 09:45:45 +0100 Subject: [PATCH] Fixed share dashboard feature, sharing temp feature is currently removed --- .../features/dashboard/dashboardNavCtrl.js | 16 +++------ src/app/features/dashboard/panelSrv.js | 2 +- .../dashboard/partials/shareModal.html} | 35 +++++++++---------- src/app/features/dashboard/sharePanelCtrl.js | 10 +++--- src/app/partials/dashLoaderShare.html | 11 ------ src/app/partials/dashboard_topnav.html | 8 +---- src/app/partials/shareDashboard.html | 18 ++++++++++ 7 files changed, 47 insertions(+), 53 deletions(-) rename src/app/{partials/share-panel.html => features/dashboard/partials/shareModal.html} (59%) delete mode 100644 src/app/partials/dashLoaderShare.html create mode 100644 src/app/partials/shareDashboard.html diff --git a/src/app/features/dashboard/dashboardNavCtrl.js b/src/app/features/dashboard/dashboardNavCtrl.js index 90ace81c502..64c24ec5404 100644 --- a/src/app/features/dashboard/dashboardNavCtrl.js +++ b/src/app/features/dashboard/dashboardNavCtrl.js @@ -39,17 +39,11 @@ function (angular, _, moment, config, store) { $location.search(search); }; - $scope.saveForSharing = function() { - var clone = angular.copy($scope.dashboard); - clone.temp = true; - $scope.db.saveDashboard(clone) - .then(function(result) { - - $scope.share = { url: result.url, title: result.title }; - - }, function(err) { - alertSrv.set('Save for sharing failed', err, 'error',5000); - }); + $scope.shareDashboard = function() { + $scope.appEvent('show-modal', { + src: './app/features/dashboard/partials/shareModal.html', + scope: $scope.$new(), + }); }; $scope.passwordCache = function(pwd) { diff --git a/src/app/features/dashboard/panelSrv.js b/src/app/features/dashboard/panelSrv.js index 3cc945624b3..2f475c249c0 100644 --- a/src/app/features/dashboard/panelSrv.js +++ b/src/app/features/dashboard/panelSrv.js @@ -24,7 +24,7 @@ function (angular, _) { $scope.sharePanel = function() { $scope.appEvent('show-modal', { - src: './app/partials/share-panel.html', + src: './app/features/dashboard/partials/shareModal.html', scope: $scope.$new() }); }; diff --git a/src/app/partials/share-panel.html b/src/app/features/dashboard/partials/shareModal.html similarity index 59% rename from src/app/partials/share-panel.html rename to src/app/features/dashboard/partials/shareModal.html index 413845f5d29..478ae3a1151 100644 --- a/src/app/partials/share-panel.html +++ b/src/app/features/dashboard/partials/shareModal.html @@ -1,21 +1,21 @@ -
-