Skip to content

fix(ui5-responsive-popover): fix header styles #3176

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 22, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/main/src/ResponsivePopover.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
{{#if header.length}}
<slot slot="header" name="header"></slot>
{{else}}
<header class="{{dialogClasses.header}}">
<header class="{{classes.header}}">
{{#if headerText }}
<ui5-title level="H2" class="ui5-popup-header-text ui5-responsive-popover-header-text">{{headerText}}</ui5-title>
{{/if}}
Expand Down
14 changes: 8 additions & 6 deletions packages/main/src/ResponsivePopover.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ class ResponsivePopover extends Popover {
return [Popover.styles, ResponsivePopoverCss];
}

get dialogClasses() {
return {
header: {
"ui5-responsive-popover-header": true,
"ui5-responsive-popover-header-no-title": !this.headerText,
},
get classes() {
const allClasses = super.classes;

allClasses.header = {
"ui5-responsive-popover-header": true,
"ui5-responsive-popover-header-no-title": !this.headerText,
};

return allClasses;
}

static get template() {
Expand Down
9 changes: 9 additions & 0 deletions packages/main/test/pages/ResponsivePopover.html
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ <h2> Inputs based component that opens popover/dialog within dialog</h2>
<ui5-date-picker></ui5-date-picker>
</ui5-dialog>

<ui5-button id="btnSimpleRP">Open Simple RP</ui5-button>
<ui5-responsive-popover id="simpleRP">
Content
</ui5-responsive-popover>

<script>
btnOpen.addEventListener("click", function(event) {
respPopover.open(btnOpen);
Expand All @@ -118,6 +123,10 @@ <h2> Inputs based component that opens popover/dialog within dialog</h2>
btnOpenDialog.addEventListener('click', function (event) {
dialog.open(btnOpenDialog);
});

btnSimpleRP.addEventListener("click", function(event) {
simpleRP.open(btnSimpleRP);
});
</script>
</body>
</html>