-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
adding styleInHead option #1313
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
Conversation
src/gridstack.js
Outdated
@@ -1092,8 +1093,9 @@ | |||
Utils.removeStylesheet(this._stylesId); | |||
} | |||
this._stylesId = 'gridstack-style-' + (Math.random() * 100000).toFixed(); | |||
// insert style to parent (instead of 'head') to support WebComponent | |||
this._styles = Utils.createStylesheet(this._stylesId, this.el.parentNode); | |||
var styleLocation = this.opts.styleInHead ? false : this.el.parentNode |
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.
I would use null or undefined instead since parent is an element pointer (issue in typescript version) but works here in JS.
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.
changed to undefined
thank you for contributing - great job at documenting and testing this. I can make a new release soon if nothing else comes up.. |
typedef for #1313 styleInHead option
TS: adding styleInHead option for #1313
Description
This change allows for keeping older behavior of gridstack where
<STYLE>
was added to<HEAD>
instead of parentNode. The default behavior remains to be to use parentNode but in situations wherehead
is preferrable just passstyleInHead = true
to gridstack options.Checklist
gridstack.js/develop
though