|
|
@@ -13,15 +13,13 @@ function (angular, _, require, config) {
|
|
|
|
|
|
$scope.init = function() {
|
|
|
$scope.editor = { index: 0 };
|
|
|
- $scope.forCurrent = true;
|
|
|
+ $scope.options = {
|
|
|
+ forCurrent: true,
|
|
|
+ toPanel: $scope.panel ? true : false,
|
|
|
+ includeTemplateVars: true
|
|
|
+ };
|
|
|
|
|
|
- if ($scope.panel) {
|
|
|
- $scope.toPanel = true;
|
|
|
- }
|
|
|
-
|
|
|
- $scope.includeTemplateVars = true;
|
|
|
$scope.buildUrl();
|
|
|
-
|
|
|
};
|
|
|
|
|
|
$scope.buildUrl = function() {
|
|
|
@@ -38,7 +36,7 @@ function (angular, _, require, config) {
|
|
|
params.from = range.from;
|
|
|
params.to = range.to;
|
|
|
|
|
|
- if ($scope.includeTemplateVars) {
|
|
|
+ if ($scope.options.includeTemplateVars) {
|
|
|
_.each(templateSrv.variables, function(variable) {
|
|
|
params['var-' + variable.name] = variable.current.text;
|
|
|
});
|
|
|
@@ -49,12 +47,12 @@ function (angular, _, require, config) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- if (!$scope.forCurrent) {
|
|
|
+ if (!$scope.options.forCurrent) {
|
|
|
delete params.from;
|
|
|
delete params.to;
|
|
|
}
|
|
|
|
|
|
- if ($scope.toPanel) {
|
|
|
+ if ($scope.options.toPanel) {
|
|
|
params.panelId = $scope.panel.id;
|
|
|
params.fullscreen = true;
|
|
|
} else {
|