diff --git a/public/app/features/templating/editorCtrl.js b/public/app/features/templating/editorCtrl.js index 2f30129eedb..852de52655d 100644 --- a/public/app/features/templating/editorCtrl.js +++ b/public/app/features/templating/editorCtrl.js @@ -96,6 +96,13 @@ function (angular, _) { } }; + $scope.duplicate = function(variable) { + $scope.current = angular.copy(variable); + $scope.variables.push($scope.current); + $scope.current.name = 'copy_of_'+variable.name; + $scope.updateSubmenuVisibility(); + }; + $scope.update = function() { if ($scope.isValid()) { $scope.runQuery().then(function() { diff --git a/public/app/features/templating/partials/editor.html b/public/app/features/templating/partials/editor.html index 133886971bd..469bbb547cf 100644 --- a/public/app/features/templating/partials/editor.html +++ b/public/app/features/templating/partials/editor.html @@ -59,6 +59,11 @@ Edit +