From ad6898f17a408f2417fd15181901df152f00ea03 Mon Sep 17 00:00:00 2001 From: Shu Muto Date: Wed, 18 Apr 2018 15:51:47 +0900 Subject: [PATCH] Suppress resize error on resizing browser This bug seems to be due to rare situation, so we could not identify the reason for now. But this bug occurred when cloud-shell.controller is missing container ID. If this bug occur, the toast popups so many and they are so obstacle. So this patch changes cloud-shell.controller to ignure the resize event when container ID was missing. Change-Id: I598c11c9fb2086e7e001b70df8de57968d6d13db Closes-Bug: #1764953 --- zun_ui/static/cloud-shell/cloud-shell.controller.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/zun_ui/static/cloud-shell/cloud-shell.controller.js b/zun_ui/static/cloud-shell/cloud-shell.controller.js index 9932682..99bd2d7 100644 --- a/zun_ui/static/cloud-shell/cloud-shell.controller.js +++ b/zun_ui/static/cloud-shell/cloud-shell.controller.js @@ -105,7 +105,8 @@ var shellIframe = angular.element("#shell-content > iframe"); var newCols = shellIframe.contents().find("#terminalNode").attr("termCols"); var newRows = shellIframe.contents().find("#terminalNode").attr("termRows"); - if ((newCols !== cols || newRows !== rows) && newCols > 0 && newRows > 0) { + if ((newCols !== cols || newRows !== rows) && newCols > 0 && newRows > 0 && + ctrl.container.id) { // resize tty zun.resizeContainer(ctrl.container.id, {width: newCols, height: newRows}).then(function() { cols = newCols;