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

added g-page component #34

Merged
merged 1 commit into from
Nov 6, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions src/g-page.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--
/*
* Copyright 2012 The Toolkitchen Authors. All rights reserved.
* Use of this source code is governed by a BSD-style
* license that can be found in the LICENSE file.
*/
-->
<element name="g-page">
<link rel="components" href="g-component.html">
<template>
<content></content>
</template>
<script>
this.component({
shadowRootCreated: function() {
this.makeFittable();
},
prototype: {
makeFittable: function() {
var sheet = document.querySelector('style[fittable]');
if (!sheet) {
sheet = document.createElement('style');
sheet.setAttribute('fittable', '');
sheet.textContent = 'html, body { ' +
'height: 100%;' +
'margin: 0;' +
'}';
document.head.appendChild(sheet);
}
}
}
});
</script>
</element>