Skip to content

Commit

Permalink
fix(ui5-upload-collection): minimum height is guaranteed in no-data m…
Browse files Browse the repository at this point in the history
…ode (#1683)
  • Loading branch information
vladitasev committed May 27, 2020
1 parent 168e505 commit 549148d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 7 deletions.
5 changes: 2 additions & 3 deletions packages/fiori/src/UploadCollection.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@

<div class="ui5-uc-root">
<div class="ui5-uc-header">
<slot name="header"></slot>
</div>
<div class="ui5-uc-content">
<div class="{{classes.content}}">
<ui5-list
mode="{{mode}}"
@ui5-selectionChange="{{_onSelectionChange}}"
Expand Down Expand Up @@ -32,4 +31,4 @@
</div>
{{/if}}
</div>
</div>
</div>
4 changes: 4 additions & 0 deletions packages/fiori/src/UploadCollection.js
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,10 @@ class UploadCollection extends UI5Element {

get classes() {
return {
content: {
"ui5-uc-content": true,
"ui5-uc-content-no-data": this._showNoData,
},
dndOverlay: {
"uc-dnd-overlay": true,
"uc-drag-overlay": this._dndOverlayMode === UploadCollectionDnDOverlayMode.Drag,
Expand Down
8 changes: 6 additions & 2 deletions packages/fiori/src/themes/UploadCollection.css
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
flex: 1 1 auto;
}

.ui5-uc-content.ui5-uc-content-no-data {
min-height: 20rem;
}

/* No Files */
.uc-no-files {
position: absolute;
Expand Down Expand Up @@ -50,7 +54,7 @@
.uc-no-files .subtitle {
font-size: var(--ui5_upload_collection_level_5Size);
color: var(--sapContent_LabelColor);
margin-bottom: 2rem;
margin-bottom: 2rem;
}

/* Drag and Drop */
Expand Down Expand Up @@ -120,4 +124,4 @@
.uc-drop-overlay ui5-icon,
.uc-drop-overlay .dnd-overlay-text {
color: var(--sapContent_DragAndDropActiveColor);
}
}
8 changes: 6 additions & 2 deletions packages/fiori/test/pages/UploadCollection.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>UploadCollection</title>
<script>
delete Document.prototype.adoptedStyleSheets
</script>

<script src="../../webcomponentsjs/webcomponents-loader.js"></script>

<script src="../../webcomponentsjs/webcomponents-loader.js"></script>
<script src="../../resources/bundle.esm.js" type="module"></script>
<script nomodule src="../../resources/bundle.es5.js"></script>

Expand Down Expand Up @@ -103,7 +107,7 @@
</ui5-upload-collection-item>
</ui5-upload-collection>

<ui5-upload-collection id="uploadCollectionDnD" style="height: 30rem;">
<ui5-upload-collection id="uploadCollectionDnD">
<div class="header" slot="header">
<ui5-title>Attachments (0)</ui5-title>
<div class="spacer"></div>
Expand Down

0 comments on commit 549148d

Please sign in to comment.