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
This commit is contained in:
Shu Muto 2018-04-18 15:51:47 +09:00
parent 57f3e6a94d
commit ad6898f17a

View File

@ -105,7 +105,8 @@
var shellIframe = angular.element("#shell-content > iframe"); var shellIframe = angular.element("#shell-content > iframe");
var newCols = shellIframe.contents().find("#terminalNode").attr("termCols"); var newCols = shellIframe.contents().find("#terminalNode").attr("termCols");
var newRows = shellIframe.contents().find("#terminalNode").attr("termRows"); 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 // resize tty
zun.resizeContainer(ctrl.container.id, {width: newCols, height: newRows}).then(function() { zun.resizeContainer(ctrl.container.id, {width: newCols, height: newRows}).then(function() {
cols = newCols; cols = newCols;