Skip to content

Instantly share code, notes, and snippets.

@thedeeno
Created June 16, 2015 02:15
Show Gist options
  • Save thedeeno/145af0d85b4bdac969b9 to your computer and use it in GitHub Desktop.
Save thedeeno/145af0d85b4bdac969b9 to your computer and use it in GitHub Desktop.
:host {
display: block;
height: 200px;
margin-top: 20px;
}
<link rel="import" href="../polymer/polymer.html">
<!--
Example:
<timeline-knots></timeline-knots>
-->
<dom-module id="timeline-knots">
<link rel="import" href="timeline-knots.css">
<template>
<svg></svg>
</template>
</dom-module>
<script src="timeline-knots.js"></script>
(function() {
Polymer({
is: 'timeline-knots',
attached: function() {
console.log('fails!', this.offsetHeight);
this.async(function() {
console.log('works!', this.offsetHeight);
}, 1);
},
});
}());
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1.0, user-scalable=yes">
<title><timeline-knots> demo</title>
<script src="../../webcomponents.min.js"></script>
<link rel="import" href="timeline-knots.html">
<style>
html {
height: 100%;
}
</style>
</head>
<body>
<timeline-knots></timeline-knots>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment