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

Commit

Permalink
reduce column width to prevent unwanted wrapping
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott J. Miles committed Apr 28, 2014
1 parent 6b7cfb2 commit a255188
Show file tree
Hide file tree
Showing 2 changed files with 152 additions and 152 deletions.
128 changes: 64 additions & 64 deletions core-doc-viewer.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<link rel="import" href="elements/core-doc-page.html">
<link rel="import" href="elements/core-doc-toc.html">
<link rel="import" href="../core-icon/core-icon.html">

<!--
Displays formatted source documentation scraped from input urls.
@class core-doc-viewer
-->

<link rel="import" href="elements/core-doc-toc.html">
<link rel="import" href="../core-icon/core-icon.html">

<!--
Displays formatted source documentation scraped from input urls.
@class core-doc-viewer
-->

<polymer-element name="core-doc-viewer" attributes="sources route url">

<template>
Expand All @@ -27,10 +27,10 @@

</style>

<context-free-parser url="{{url}}" on-data-ready="{{parserDataReady}}"></context-free-parser>

<template repeat="{{sources}}">
<context-free-parser url="{{}}" on-data-ready="{{parserDataReady}}"></context-free-parser>
<context-free-parser url="{{url}}" on-data-ready="{{parserDataReady}}"></context-free-parser>

<template repeat="{{sources}}">
<context-free-parser url="{{}}" on-data-ready="{{parserDataReady}}"></context-free-parser>
</template>

<core-layout core-flex>
Expand All @@ -42,57 +42,57 @@

<script>

Polymer('core-doc-viewer', {

classes: [],
sources: [],

ready: function() {
window.addEventListener('hashchange', this.parseLocationHash.bind(this));
this.parseLocationHash();
},

parseLocationHash: function() {
this.route = window.location.hash.slice(1);
},

routeChanged: function() {
this.validateRoute();
},

validateRoute: function() {
if (this.route) {
this.classes.some(function(c) {
if (c.name === this.route) {
this.data = c;
this.route = '';
return;
}
}, this);
}
},

selectedChanged: function() {
this.data = this.classes[this.selected];
},

parserDataReady: function(event) {
this.assimilateData(event.target.data);
},

assimilateData: function(data) {
this.classes = this.classes.concat(data.classes);
this.classes.sort(function(a, b) {
var na = a && a.name.toLowerCase(), nb = b && b.name.toLowerCase();
return (na < nb) ? -1 : (na == nb) ? 0 : 1;
});
if (!this.data && !this.route && this.classes.length) {
this.data = this.classes[0];
}
if (this.classes.length > 1) {
this.$.toc.style.display = 'block';
}
this.validateRoute();
Polymer('core-doc-viewer', {

classes: [],
sources: [],

ready: function() {
window.addEventListener('hashchange', this.parseLocationHash.bind(this));
this.parseLocationHash();
},

parseLocationHash: function() {
this.route = window.location.hash.slice(1);
},

routeChanged: function() {
this.validateRoute();
},

validateRoute: function() {
if (this.route) {
this.classes.some(function(c) {
if (c.name === this.route) {
this.data = c;
this.route = '';
return;
}
}, this);
}
},

selectedChanged: function() {
this.data = this.classes[this.selected];
},

parserDataReady: function(event) {
this.assimilateData(event.target.data);
},

assimilateData: function(data) {
this.classes = this.classes.concat(data.classes);
this.classes.sort(function(a, b) {
var na = a && a.name.toLowerCase(), nb = b && b.name.toLowerCase();
return (na < nb) ? -1 : (na == nb) ? 0 : 1;
});
if (!this.data && !this.route && this.classes.length) {
this.data = this.classes[0];
}
if (this.classes.length > 1) {
this.$.toc.style.display = 'block';
}
this.validateRoute();
}

});
Expand Down
176 changes: 88 additions & 88 deletions elements/core-doc-page.css
Original file line number Diff line number Diff line change
@@ -1,156 +1,156 @@
:host {
display: block;
}

:host {
display: block;
}

#panel {
height: 100%;
}

}

.main {
padding: 0 72px;
max-width: 832px;
margin: 0 auto;
}

}

markedjs-element {
display: block;
}

}

h1 {
font-size: 52px;
color: #E91E63
}

.element {
font-size: 21px;
}

.name {
/* typography */
color: white;
/* font-size: 14px; */
font-size: 12px;
font-weight: bold;
text-decoration: none;
/* colors / effects */
background-color: #999;
box-shadow: 0 1px 2px 0px rgba(0, 0, 0, 0.1);
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.1);
border-radius: 2px;
cursor: pointer;
/* metrics */
display: inline-block;
padding: 4px 12px 5px 12px;
margin: 4px 0;
}

.ntitle {
font-size: 26px;
}

.box {
margin-bottom: 40px;
}

.top pre {
padding: 12px 13px;
}

.element {
font-size: 21px;
}

.name {
/* typography */
color: white;
/* font-size: 14px; */
font-size: 12px;
font-weight: bold;
text-decoration: none;
/* colors / effects */
background-color: #999;
box-shadow: 0 1px 2px 0px rgba(0, 0, 0, 0.1);
box-shadow: 0 0 1px 0 rgba(0, 0, 0, 0.1);
border-radius: 2px;
cursor: pointer;
/* metrics */
display: inline-block;
padding: 4px 12px 5px 12px;
margin: 4px 0;
}

.ntitle {
font-size: 26px;
}

.box {
margin-bottom: 40px;
}

.top pre {
padding: 12px 13px;
background-color: #f8f8f8;
}

}

code {
font-family: Consolas, monospace;
border: 1px solid #ddd;
background-color: #f8f8f8;
border-radius: 3px;
padding: 0 3px;
}

pre code {
max-width: 832px;
white-space: pre-wrap;
overflow: hidden;
border: none;
}

/**/

}

pre code {
max-width: 832px;
white-space: pre-wrap;
overflow: hidden;
border: none;
}

/**/

.details-name {
display: inline-block;
vertical-align: top;
width: 220px;
}
display: inline-block;
vertical-align: top;
width: 190px;
}

.details-info {
display: inline-block;
max-width: 540px;
display: inline-block;
max-width: 540px;
}

.attribute-box {
}

}

.attribute-box .details {
background-color: #FFF9C4;
padding: 8px 16px;
border-bottom: 1px solid #D1CCA1;
}

}

.attribute-box .ntitle {
padding: 24px 16px;
}


.attribute-box code {
color: #FFAB40;
border: none;
background-color: transparent;
border-radius: none;
padding: 0;
font-size: 1.2em;
}

}

.method-box {
}

}

.method-box .details {
background-color: #F0F4C3;
padding: 8px 16px;
border-bottom: 1px solid #D1CCA1;
}

}

.method-box .ntitle {
background-color: #9E9D24;
background-color: #9E9D24;
padding: 24px 16px;
}


.method-box code {
color: #9E9D24;
border: none;
background-color: transparent;
border-radius: none;
padding: 0;
font-size: 1.2em;
}

}

.event-box {
}

}

.event-box .details {
background-color: #B2DFDB;
padding: 8px 16px;
border-bottom: 1px solid #92B7B3;
}

}

.event-box .ntitle {
background-color: #009688;
background-color: #009688;
padding: 24px 16px;
}


.event-box code {
color: #009688;
border: none;
background-color: transparent;
border-radius: none;
padding: 0;
font-size: 1.2em;
}


}

0 comments on commit a255188

Please sign in to comment.