g-page: intended as a extendor for components that want to fill the browser window.

This commit is contained in:
Steve Orvell
2012-11-05 16:53:32 -08:00
parent fe450af736
commit 1bfc113a79

34
src/g-page.html Normal file
View File

@@ -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>