Close child windows on dialog close

Fixes issue with crash when parent window was already closed
and then user tried to close child window.
Example: Tools -> Spelling and message box ("Spellcheck completed")

Change-Id: I30fef5adb33ba4208b1ee48f3bbced1cff2969d1
Reviewed-on: https://gerrit.libreoffice.org/c/online/+/91468
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Andras Timar <andras.timar@collabora.com>
This commit is contained in:
Szymon Kłos 2020-04-01 10:56:31 +02:00 committed by Andras Timar
parent cd73939022
commit fbaedcd212

View file

@ -1183,7 +1183,23 @@ L.Control.LokDialog = L.Control.extend({
console.log('_onCalcInputBarClose: end');
},
_closeChildWindows: function(dialogId) {
// child windows - with greater id number
var that = this;
var foundCurrent = false;
Object.keys(this._dialogs).forEach(function(id) {
if (foundCurrent && !that._isSidebar(id) && !that._isCalcInputBar(id))
that._onDialogClose(id, true);
if (id == dialogId)
foundCurrent = true;
});
},
_onDialogClose: function(dialogId, notifyBackend) {
this._closeChildWindows(dialogId);
if (window.ThisIsTheiOSApp)
w2ui['editbar'].enable('closemobile');