-
Notifications
You must be signed in to change notification settings - Fork 2k
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
domReady #1587
Comments
DOM measurement should be performed in It is incorrect to perform DOM measurement in |
Thanks. I have tried In 0.5: <polymer-element name="math-brack" attributes="l r">
<template>
<span class="math-font-x-light" style="font-size: {{fs}}">{{l}}</span>
<content></content>
<span class="math-font-x-light" style="font-size: {{fs}}">{{r}}</span>
</template>
<script>
Polymer({
l: '(',
r: ')',
domReady: function () {
this.fs = parseInt(window.getComputedStyle(this).height, 10) + 'px';
}
});
</script>
</polymer-element> It works here: http://charbelrami.github.io/math-elements/ In 0.9: <dom-module id="math-brack">
<template>
<span class="math-font-x-light" style$="{{fs}}">{{l}}</span>
<content></content>
<span class="math-font-x-light" style$="{{fs}}">{{r}}</span>
</template>
</dom-module>
<script>
Polymer({
is: 'math-brack',
properties: {
l: {
type: String,
value: '('
},
r: {
type: String,
value: ')'
}
},
attached: function() {
this.fs = 'font-size: ' + parseInt(window.getComputedStyle(this).height, 10) + 'px';
}
});
</script> It does not work. |
In version 0.5
returns the height value of the element.
Without domReady in version 0.9, it returns NaN (height: auto) because the element has not been rendered yet.
Is there any alternative to domReady?
Thanks
The text was updated successfully, but these errors were encountered: