Explorar o código

Merge branch 'v3.0.x'

Torkel Ödegaard %!s(int64=9) %!d(string=hai) anos
pai
achega
06d63dda6e
Modificáronse 1 ficheiros con 15 adicións e 3 borrados
  1. 15 3
      public/app/features/dashboard/rowCtrl.js

+ 15 - 3
public/app/features/dashboard/rowCtrl.js

@@ -142,12 +142,18 @@ function (angular, _, config) {
   });
 
   module.directive('panelWidth', function() {
+    var fullscreen = false;
+
     return function(scope, element) {
       function updateWidth() {
-        element[0].style.width = ((scope.panel.span / 1.2) * 10) + '%';
+        if (!fullscreen) {
+          element[0].style.width = ((scope.panel.span / 1.2) * 10) + '%';
+        }
       }
 
       scope.onAppEvent('panel-fullscreen-enter', function(evt, info) {
+        fullscreen = true;
+
         if (scope.panel.id !== info.panelId) {
           element.hide();
         } else {
@@ -156,14 +162,20 @@ function (angular, _, config) {
       });
 
       scope.onAppEvent('panel-fullscreen-exit', function(evt, info) {
+        fullscreen = false;
+
         if (scope.panel.id !== info.panelId) {
           element.show();
-        } else {
-          updateWidth();
         }
+
+        updateWidth();
       });
 
       scope.$watch('panel.span', updateWidth);
+
+      if (fullscreen) {
+        element.hide();
+      }
     };
   });