-
Notifications
You must be signed in to change notification settings - Fork 14
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
Firefox Support #2
base: master
Are you sure you want to change the base?
Conversation
Firefox Support
Change Margin Default to 20
This commit does the exact same changes to support firefox, but in the typescript source
Firefox support in TypeScript sources
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the PR. Left a few comments
dist/D3SeatingChart.js
Outdated
let parentHeight = this.element.clientHeight; | ||
let parentWidth = this.element.clientWidth || this.element.getBoundingClientRect().width; | ||
let parentHeight = this.element.clientHeight || this.element.getBoundingClientRect().height; | ||
if (!parentWidth || !parentHeight) return; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An error should be thrown if the dimensions aren't found
@iamchairs - Thanks for taking the time to review this. I've added a The side effect of throwing an error here is that SVG element must be visible on the page when constructing your |
@iamchairs - I currently have a PR up against my repo to reflect these changes in the |
Support for Firefox in the typescript sources
Closing until all updates are in place, then will re-open. |
Alright, I think we should be good to go here. Typescript and JavaScript files are all up to date. I had to make another change after finding that Event.srcElement is not supported in Firefox versions < 62. Tested on Firefox and Chrome, and everything is working as expected. @iamchairs - mind checking this out when you get a chance? |
Pinging @iamchairs - I know this has been up for a while now, but mind taking a look? Would be nice to have this merged in. |
As described here: https://bugzilla.mozilla.org/show_bug.cgi?id=874811, Firefox will always return
0
forclientWidth
andclientHeight
. This PR will fall back onthis.element.getBoundingClientRect()
shouldclientWidth
orclientHeight
return falsey values.This PR also:
D3SeatingChart.attach(<element>, <chart_options>, <margin_px>)
D3SeatingChart.attach(document.getElementById('my-svg'), { showBehavior: ShowBehavior.AllDecendants }, 5)
zoom
function ifparentWidth
orparentHeight
are falsey values. This prevents scaling by 0, transforming by NaN, etc.Fixes #3
Fixes #4
Fixes #5