Skip to content

Commit 8510ffb

Browse files
1 parent d4b1b01 commit 8510ffb

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

app/webapp/controller/App.controller.js

+12-5
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ sap.ui.define("z2ui5/Favicon", ["sap/ui/core/Control"], (Control) => {
10351035
}
10361036
);
10371037

1038-
sap.ui.define("z2ui5/Dirty", ["sap/ui/core/Control", "sap/ushell/Container"], (Control, Container) => {
1038+
sap.ui.define("z2ui5/Dirty", ["sap/ui/core/Control"], (Control) => {
10391039
"use strict";
10401040
return Control.extend("z2ui5.Dirty", {
10411041
metadata: {
@@ -1046,15 +1046,22 @@ sap.ui.define("z2ui5/Dirty", ["sap/ui/core/Control", "sap/ushell/Container"], (C
10461046
}
10471047
},
10481048
setIsDirty(val) {
1049-
if (Container) {
1050-
Container.setDirtyFlag(val);
1051-
} else {
1052-
window.onbeforeunload = function (e) {
1049+
1050+
sap.ui.require([ "sap/ushell/Container"
1051+
], async (Container) => {
1052+
1053+
if (Container) {
1054+
Container.setDirtyFlag(val);
1055+
} else {
1056+
window.onbeforeunload = function (e) {
10531057
if (val) {
10541058
e.preventDefault();
10551059
}
10561060
}
10571061
}
1062+
1063+
});
1064+
10581065
},
10591066
renderer(oRm, oControl) { }
10601067
});

0 commit comments

Comments
 (0)