mirror of
https://github.com/Polymer/polymer.git
synced 2025-02-25 18:55:30 -06:00
g-page: intended as a extendor for components that want to fill the browser window.
This commit is contained in:
34
src/g-page.html
Normal file
34
src/g-page.html
Normal 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>
|
||||
Reference in New Issue
Block a user