enable toggle debug popup (#1563)

This commit is contained in:
Christian Günter 2024-11-22 07:38:36 +01:00 committed by GitHub
parent ef50f709ce
commit 72798539a0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 28 additions and 2 deletions

View File

@ -37,7 +37,13 @@ sap.ui.define(["sap/ui/core/UIComponent", "z2ui5/model/models",
document.addEventListener("keydown", function (zEvent) {
if (zEvent?.ctrlKey && zEvent?.key === "F12") {
new z2ui5.cc.DebugTool().show();
if (!z2ui5.debugTool){
z2ui5.debugTool = new z2ui5.cc.DebugTool();
z2ui5.debugTool.show();
} else {
z2ui5.debugTool.close();
z2ui5.debugTool = null;
}
}
});
},

View File

@ -137,6 +137,13 @@ sap.ui.define(["sap/ui/core/Control", "sap/ui/core/Fragment", "sap/ui/model/json
this.oDialog.addStyleClass('dbg-ltr');
this.oDialog.setModel(oModel);
this.oDialog.open();
},
async close(){
if (this.oDialog){
this.oDialog.close();
this.oDialog.destry();
}
}
});
});

View File

@ -57,7 +57,13 @@ CLASS z2ui5_cl_app_component_js IMPLEMENTATION.
`` && |\n| &&
` document.addEventListener("keydown", function (zEvent) {` && |\n| &&
` if (zEvent?.ctrlKey && zEvent?.key === "F12") {` && |\n| &&
` new z2ui5.cc.DebugTool().show();` && |\n| &&
` if (!z2ui5.debugTool){` && |\n| &&
` z2ui5.debugTool = new z2ui5.cc.DebugTool();` && |\n| &&
` z2ui5.debugTool.show();` && |\n| &&
` } else {` && |\n| &&
` z2ui5.debugTool.close();` && |\n| &&
` z2ui5.debugTool = null;` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
` },` && |\n| &&

View File

@ -157,6 +157,13 @@ CLASS z2ui5_cl_app_debugtool_js IMPLEMENTATION.
` this.oDialog.addStyleClass('dbg-ltr');` && |\n| &&
` this.oDialog.setModel(oModel);` && |\n| &&
` this.oDialog.open();` && |\n| &&
` },` && |\n| &&
`` && |\n| &&
` async close(){` && |\n| &&
` if (this.oDialog){` && |\n| &&
` this.oDialog.close();` && |\n| &&
` this.oDialog.destry();` && |\n| &&
` }` && |\n| &&
` }` && |\n| &&
` });` && |\n| &&
`});` && |\n| &&