Skip to content

Commit

Permalink
fix: dialog margin in sapUiSizeCozy mode (#562)
Browse files Browse the repository at this point in the history
  • Loading branch information
marianfoo authored May 16, 2024
1 parent ba7f525 commit 4104fb9
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions packages/ui5-cc-spreadsheetimporter/src/Component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import View from "sap/ui/core/mvc/View";
export default class Component extends UIComponent {
spreadsheetUpload: SpreadsheetUpload;
private _sContentDensityClass: any;
public _densityClass: string;
public logger: Logger;
oContainer: ComponentContainer;
settingsFromContainer: $ComponentSettings;
Expand Down Expand Up @@ -283,6 +284,8 @@ export default class Component extends UIComponent {
// check whether FLP has already set the content density class; do nothing in this case
if (document.body.classList.contains("sapUiSizeCozy") || document.body.classList.contains("sapUiSizeCompact")) {
this._sContentDensityClass = "";
// set _densityClass to "sapUiSizeCozy" or "sapUiSizeCompact" depending on the current content density
this._densityClass = document.body.classList.contains("sapUiSizeCozy") ? "sapUiSizeCozy" : "sapUiSizeCompact";
} else if (!Device.support.touch) {
// apply "compact" mode if touch is not supported
this._sContentDensityClass = "sapUiSizeCompact";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,8 @@ export default class SpreadsheetUploadDialog extends ManagedObject {
hidePreview: this.component.getHidePreview(),
showOptions: this.component.getShowOptions(),
hideGenerateTemplateButton: false,
fileUploadValue: ""
fileUploadValue: "",
densityClass: this.component._densityClass
});
this.spreadsheetUploadDialog = (await Fragment.load({
name: "cc.spreadsheetimporter.XXXnamespaceXXX.fragment.SpreadsheetUpload",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
<core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:upload="sap.ui.unified" xmlns:spreadsheetdialog="cc.spreadsheetimporter.XXXnamespaceXXX.control">
<spreadsheetdialog:SpreadsheetDialog contentWidth="{= ${device>/system/phone} ? '100%' : '40vw' }" contentHeight="110px" verticalScrolling="false">
<spreadsheetdialog:SpreadsheetDialog
contentWidth="{= ${device>/system/phone} ? '100%' : '40vw' }"
contentHeight="{= ${info>/densityClass} === 'sapUiSizeCompact' ? '110px' : '120px'}"
verticalScrolling="false"
>
<spreadsheetdialog:customHeader>
<OverflowToolbar>
<Title text="{i18n>spreadsheetimporter.spreadsheetupload}" />
Expand Down

0 comments on commit 4104fb9

Please sign in to comment.