Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
code-mirror element must be sized
Browse files Browse the repository at this point in the history
  • Loading branch information
sorvell committed Apr 7, 2014
1 parent 3f0157c commit 5b8917e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 61 deletions.
2 changes: 2 additions & 0 deletions code-mirror.html
Expand Up @@ -32,8 +32,10 @@
<style>
:host {
display: block;
position: relative;
}
.CodeMirror {
position: absolute;
height: 100%;
}
</style>
Expand Down
14 changes: 11 additions & 3 deletions demo.html
Expand Up @@ -12,9 +12,17 @@
<link rel="import" href="code-mirror.html">
<style>
body {
position: relative;
height: 500px;
width: 500px;
margin: 0;
position: absolute;
top: 0;
left: 0;
height: 100%;
width: 100%;
}

code-mirror {
height: 100%;
width: 100%;
}
</style>
</head>
Expand Down
74 changes: 16 additions & 58 deletions index.html
@@ -1,64 +1,22 @@
<!doctype html>
<!--
Copyright (c) 2014 The Polymer Project Authors. All rights reserved.
This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE
The complete set of authors may be found at http://polymer.github.io/AUTHORS
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS
Code distributed by Google as part of the polymer project is also
subject to an additional IP rights grant found at http://polymer.github.io/PATENTS
-->
<html>
<head>
<title>polymer api</title>
<style>
html, body {
font-family: Arial, sans-serif;
white-space: nowrap;
overflow: hidden;
}
[noviewer] [ifnoviewer] {
display: block;
}
[detector], [ifnoviewer], [noviewer] [ifviewer] {
display: none;
}
[ifviewer], [ifnoviewer] {
position: absolute;
top: 0;
right: 0;
bottom: 0;
left: 0;
}
iframe {
border: none;
margin: 0;
width: 100%;
height: 100%;
}
#remote {
position: absolute;
top: 0;
right: 0;
}
</style>

<script src="../platform/platform.js"></script>
<link rel="import" href="../polymer-home-page/polymer-home-page.html">
<link rel="import" href="../core-component-page/core-component-page.html">

</head>
<body>
<img detector src="../polymer-home-page/bowager-logo.png" onerror="noviewer()">
<polymer-home-page ifviewer></polymer-home-page>
<div ifnoviewer>
<span id="remote">[remote]</span>
<iframe></iframe>
</div>
<!-- -->
<script>
var remoteDocs = 'http://turbogadgetry.com/bowertopia/components/';
// if no local info viewer, load it remotely
function noviewer() {
document.body.setAttribute('noviewer', '');
var path = location.pathname.split('/');
var module = path.pop() || path.pop();
document.querySelector('iframe').src = remoteDocs + module;
document.querySelector('title').textContent = module;
}
// for testing only
var opts = window.location.search;
if (opts.indexOf('noviewer') >= 0) {
noviewer();
}
</script>
<body unresolved>

<core-component-page></core-component-page>

</body>
</html>
</html>

0 comments on commit 5b8917e

Please sign in to comment.