Only apply forced max mode when panel is shown (#15752) (#15761)

This commit is contained in:
Tim Roes 2017-12-23 19:58:59 +01:00 committed by GitHub
parent 7fa21bf39d
commit 91b8340a7d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View file

@ -181,6 +181,13 @@ describe('visualize spy panel', function () {
expect($el.panel.hasClass('only')).to.equal(true);
expect(visElement.hasClass('spy-only')).to.equal(true);
});
it('should not trigger forced maximized mode, when spy is not shown', () => {
visElement.height(50);
compile();
$timeout.flush();
expect(visElement.hasClass('spy-only')).to.equal(false);
});
});
describe('spy modes', () => {

View file

@ -37,7 +37,7 @@ uiModules
function checkForcedMaximized() {
$timeout(() => {
if ($scope.visElement && $scope.visElement.height() < 180) {
if ($scope.visElement && $scope.currentMode && $scope.visElement.height() < 180) {
$scope.forceMaximized = true;
} else {
$scope.forceMaximized = false;