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

Passing some UI Defaults to loleaflet frame #1211

Merged
merged 3 commits into from
Nov 2, 2020

Conversation

merttumer
Copy link
Collaborator

These ui defaults determine some widget states
at the start of the document which is hidden or shown
Some of them such as Ruler Statusbar and Sidebar can be
hidden at start with this patch. If not set, collabora
online will assume they are true

Signed-off-by: Mert Tumer mert.tumer@collabora.com

  • Resolves: #
  • Target version: master

Summary

TODO

  • ...

Checklist

  • Code is properly formatted
  • Sign-off message is added to all commits
  • Documentation (manuals or wiki) has been updated or is not required

These ui defaults determine some widget states
at the start of the document which is hidden or shown
Some of them such as Ruler Statusbar and Sidebar can be
hidden at start with this patch. If not set, collabora
online will assume they are true

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
@merttumer
Copy link
Collaborator Author

@juliushaertl Can you please review these patches? Thank you

Signed-off-by: Mert Tumer <mert.tumer@collabora.com>
@gary-kim gary-kim added 3. to review Ready to be reviewed enhancement New feature or request labels Oct 28, 2020
Copy link
Member

@juliushaertl juliushaertl left a comment

Choose a reason for hiding this comment

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

See inline for smaller comments. In general window.parent should be avoided as it doesn't work across different domains, which might occur in federated or global scale setups.

Otherwise 👍 from my side.

}
var str = ''
for (var cssVarKey in cssVarMap) {
var cStyle = window.parent.getComputedStyle(document.documentElement).getPropertyValue(cssVarKey)
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var cStyle = window.parent.getComputedStyle(document.documentElement).getPropertyValue(cssVarKey)
var cStyle = window.getComputedStyle(document.documentElement).getPropertyValue(cssVarKey)

Copy link
Member

Choose a reason for hiding this comment

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

The CSS variables are also properly loaded inside of the document frame.

var cStyle = window.parent.getComputedStyle(document.documentElement).getPropertyValue(cssVarKey)
if (!cStyle) {
// try suffix -dark instead
cStyle = window.parent.getComputedStyle(document.documentElement).getPropertyValue(cssVarKey + '-dark')
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
cStyle = window.parent.getComputedStyle(document.documentElement).getPropertyValue(cssVarKey + '-dark')
cStyle = window.getComputedStyle(document.documentElement).getPropertyValue(cssVarKey + '-dark')

Copy link
Collaborator Author

@merttumer merttumer Nov 2, 2020

Choose a reason for hiding this comment

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

Thank you for the reply. Initially it was like this but later we discovered that it does not work on Firefox without parent. The CSS variables become empty string. The only solution I found was using window.parent.

Copy link
Member

Choose a reason for hiding this comment

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

Indeed seems to be a firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1471231

Then let's get this in as it is and maybe see if we can work around that by not using display: none; but opacity of 0 until the frame is loaded.

src/document.js Outdated Show resolved Hide resolved
Co-authored-by: Julius Härtl <jus@bitgrid.net>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Ready to be reviewed enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants