Skip to content
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

fix: apply size "compact" for StaticArea items #1204

Merged
merged 6 commits into from
Feb 11, 2020

Conversation

ilhan007
Copy link
Member

No description provided.

@ilhan007 ilhan007 changed the title wip: set compact in static area fix: apply size "compact" for StaticArea items Feb 11, 2020
Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks great, exactly what we need IMO

}

updateStaticAreaItemContentDensity() {
const staticAreaItem = this.getStaticAreaItemDomRef().host;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO it's a bit safer to check for ".host" only if there is staticAreaItemDomRef()

const staticAreaItem = this.getStaticAreaItemDomRef().host;

if (staticAreaItem) {
staticAreaItem.classList.toggle("sapUiSizeCompact", this.isCompact);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note: The second parameter is not supported in Internet Explorer or Opera 12 and earlier.
https://www.w3schools.com/jsref/prop_element_classlist.asp
Just verified it, does not work on IE.

Also, this could would better become a function in StaticAreaItem.js and you just call this function from updateStaticAreaItemContentDensity

Copy link
Contributor

@vladitasev vladitasev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works great. We'll have to find a workaround for IE at least for the most common use cases, but this is related to the whole compact/cozy story, not just this change.

@ilhan007 ilhan007 merged commit c411774 into master Feb 11, 2020
@ilhan007 ilhan007 deleted the fix-compact-in-staticarea branch February 11, 2020 14:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants