Commit 186f753a by Torkel Ödegaard

style changing now works again

parent f180707b
...@@ -45,6 +45,8 @@ function (angular, $, config, _) { ...@@ -45,6 +45,8 @@ function (angular, $, config, _) {
$rootScope.fullscreen = false; $rootScope.fullscreen = false;
$scope.dashboard = dashboard.create(dashboardData); $scope.dashboard = dashboard.create(dashboardData);
$scope.grafana.style = $scope.dashboard.style;
$scope.filter = filterSrv; $scope.filter = filterSrv;
$scope.filter.init($scope.dashboard); $scope.filter.init($scope.dashboard);
......
...@@ -17,7 +17,7 @@ function (angular, _, moment) { ...@@ -17,7 +17,7 @@ function (angular, _, moment) {
$scope.elasticsearch = $scope.elasticsearch || {}; $scope.elasticsearch = $scope.elasticsearch || {};
$scope.onAppEvent('save-dashboard', function() { $scope.onAppEvent('save-dashboard', function() {
$scope.elasticsearch_save('dashboard', false); $scope.saveDashboard();
}); });
$scope.onAppEvent('zoom-out', function() { $scope.onAppEvent('zoom-out', function() {
...@@ -142,6 +142,10 @@ function (angular, _, moment) { ...@@ -142,6 +142,10 @@ function (angular, _, moment) {
}); });
}; };
$scope.styleUpdated = function() {
$scope.grafana.style = $scope.dashboard.style;
};
$scope.openSaveDropdown = function() { $scope.openSaveDropdown = function() {
$scope.isFavorite = playlistSrv.isCurrentFavorite($scope.dashboard); $scope.isFavorite = playlistSrv.isCurrentFavorite($scope.dashboard);
}; };
......
...@@ -15,6 +15,9 @@ function (angular, config, _) { ...@@ -15,6 +15,9 @@ function (angular, config, _) {
$scope.init = function() { $scope.init = function() {
$scope._ = _; $scope._ = _;
$scope.dashAlerts = alertSrv; $scope.dashAlerts = alertSrv;
$scope.grafana = {
style: 'dark'
};
}; };
$rootScope.onAppEvent = function(name, callback) { $rootScope.onAppEvent = function(name, callback) {
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
<label class="small">Title</label><input type="text" class="input-large" ng-model='dashboard.title'></input> <label class="small">Title</label><input type="text" class="input-large" ng-model='dashboard.title'></input>
</div> </div>
<div class="editor-option"> <div class="editor-option">
<label class="small">Style</label><select class="input-small" ng-model="dashboard.style" ng-options="f for f in ['dark','light']"></select> <label class="small">Theme</label><select class="input-small" ng-model="dashboard.style" ng-options="f for f in ['dark','light']" ng-change="styleUpdated()"></select>
</div> </div>
<div class="editor-option"> <div class="editor-option">
<label class="small">Time correction</label> <label class="small">Time correction</label>
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<body ng-cloak ng-controller="GrafanaCtrl"> <body ng-cloak ng-controller="GrafanaCtrl">
<link rel="stylesheet" href="css/bootstrap.light.min.css" ng-if="dashboard.style === 'light'"> <link rel="stylesheet" href="css/bootstrap.light.min.css" ng-if="grafana.style === 'light'">
<link rel="stylesheet" href="css/bootstrap-responsive.min.css"> <link rel="stylesheet" href="css/bootstrap-responsive.min.css">
<link rel="stylesheet" href="css/font-awesome.min.css"> <link rel="stylesheet" href="css/font-awesome.min.css">
......
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