Просмотр исходного кода

DashboardViewState: small fix for bug that caused issue for singlestat panel

Torkel Ödegaard 11 лет назад
Родитель
Сommit
8bb51d47f8

+ 2 - 0
src/app/panels/singlestat/singleStatPanel.js

@@ -138,6 +138,8 @@ function (angular, app, _, $) {
         }
 
         function render() {
+          if (!scope.data) { return; }
+
           data = scope.data;
           panel = scope.panel;
 

+ 2 - 1
src/app/services/dashboard/dashboardViewStateSrv.js

@@ -69,7 +69,8 @@ function (angular, _, $) {
 
       if (!this.state.fullscreen) {
         this.state.panelId = null;
-        this.state.edit = false;
+        this.state.fullscreen = null;
+        this.state.edit = null;
       }
 
       if (!skipUrlSync) {

+ 1 - 1
src/test/specs/dashboardViewStateSrv-specs.js

@@ -30,7 +30,7 @@ define([
         viewState.update({fullscreen: false});
         expect(location.search()).to.eql({});
         expect(viewState.fullscreen).to.be(false);
-        expect(viewState.state.fullscreen).to.be(false);
+        expect(viewState.state.fullscreen).to.be(null);
       });
     });