Commit 27a0ef7e by Torkel Ödegaard

Merge branch 'master' of github.com:grafana/grafana

parents 5eab5dc4 2f3587ee
...@@ -49,6 +49,21 @@ function (angular, _) { ...@@ -49,6 +49,21 @@ function (angular, _) {
$scope.appEvent('hide-dash-search'); $scope.appEvent('hide-dash-search');
}; };
$scope.makeEditable = function() {
$scope.dashboard.editable = true;
var clone = $scope.dashboard.getSaveModelClone();
backendSrv.saveDashboard(clone, {overwrite: false}).then(function(data) {
$scope.dashboard.version = data.version;
$scope.appEvent('dashboard-saved', $scope.dashboard);
$scope.appEvent('alert-success', ['Dashboard saved', 'Saved as ' + clone.title]);
//force refresh whole page
window.location.href = window.location.href;
}, $scope.handleSaveDashError);
};
$scope.saveDashboard = function(options) { $scope.saveDashboard = function(options) {
if ($scope.dashboardMeta.canSave === false) { if ($scope.dashboardMeta.canSave === false) {
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment