-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34 from sorvell/master
added g-page component
- Loading branch information
Showing
1 changed file
with
34 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |