By replacing the widget.resize function (later referred to by board.resize in usage of the board) with the ResizeObserverAPI, the board is automatically resized when the window is resized.
Another important reason for this change is that by following the documentation provided with an event listener on the window, the board is not always resized properly:
When closing the window too fast, the board isn't resized respectively and overflows out of the body. By using a resize observer, this issue is resolved.
Quick Note
I've also formatted the code so that there are semicolons at the end of each line of code respectively (hence the large number of changes!)
Main change
By replacing the
widget.resize
function (later referred to by board.resize in usage of the board) with theResizeObserverAPI
, the board is automatically resized when the window is resized.Another important reason for this change is that by following the documentation provided with an event listener on the window, the board is not always resized properly:
When closing the window too fast, the board isn't resized respectively and overflows out of the body. By using a resize observer, this issue is resolved.
Quick Note
I've also formatted the code so that there are semicolons at the end of each line of code respectively (hence the large number of changes!)