Skip to content

Commit

Permalink
Fix issue #258
Browse files Browse the repository at this point in the history
  • Loading branch information
Emmanuel Garcia committed Jun 20, 2016
1 parent 5ce4995 commit 57f8741
Show file tree
Hide file tree
Showing 6 changed files with 414 additions and 370 deletions.
1 change: 0 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"iron-icons": "polymerelements/iron-icons#^1.0.0",
"iron-scroll-threshold": "polymerelements/iron-scroll-threshold#^1.0.0",
"iron-image": "polymerelements/iron-image#^1.0.0",
"paper-menu": "polymerelements/paper-menu#^1.0.0",
"paper-item": "polymerelements/paper-item#^1.0.0",
"paper-icon-button": "polymerelements/paper-icon-button#^1.0.0",
"paper-button": "polymerelements/paper-button#^1.0.0",
Expand Down
169 changes: 169 additions & 0 deletions demo/cards.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
<!--
@license
Copyright (c) 2015 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.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
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.txt
-->

<!doctype html>
<html id="html">
<head>

<title>iron-list demo</title>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">

<script src="../../webcomponentsjs/webcomponents-lite.js"></script>

<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../../app-layout/app-header/app-header.html">
<link rel="import" href="../../app-layout/app-toolbar/app-toolbar.html">
<link rel="import" href="../../app-layout/app-scroll-effects/app-scroll-effects.html">
<link rel="import" href="../../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../../iron-ajax/iron-ajax.html">
<link rel="import" href="../../iron-icons/iron-icons.html">
<link rel="import" href="../../iron-image/iron-image.html">
<link rel="import" href="../iron-list.html">

<style is="custom-style">
body {
@apply(--layout-fullbleed);
font-family: 'Roboto', 'Noto', sans-serif;
background-color: #eee;
}

app-header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1;
background-color: #0b8043;
color: white;
--app-header-background-front-layer: {
background-color: #4285f4;
};
}

app-header paper-icon-button {
--paper-icon-button-ink-color: white;
}

[title] {
font-weight: 400;
margin: 0 0 0 50px;
}

[condensed-title] {
font-weight: 400;
margin-left: 30px;
}

[condensed-title] i {
font-style: normal;
font-weight: 100;
}

app-toolbar.tall {
height: 148px;
}

iron-list {
padding-top: 148px;
margin-top: 64px;
padding-bottom: 16px;
}

.item {
@apply(--layout-horizontal);
padding: 20px;
border-radius: 8px;
background-color: white;
border: 1px solid #ddd;
max-width: 800px;
margin: 16px auto 0 auto;
}

.item:focus {
outline: 0;
border-color: #333;
}

.avatar {
height: 40px;
width: 40px;
border-radius: 20px;
box-sizing: border-box;
background-color: #DDD;
}

.pad {
padding: 0 16px;
@apply(--layout-flex);
@apply(--layout-vertical);
}

.primary {
font-size: 16px;
font-weight: bold;
}

.secondary {
font-size: 14px;
}

.dim {
color: gray;
}

.spacer {
@apply(--layout-flex);
}

</style>

</head>
<body unresolved>

<template is="dom-bind">
<iron-ajax url="data/contacts.json" last-response="{{data}}" auto></iron-ajax>

<app-header condenses fixed effects="resize-title blend-background waterfall">
<app-toolbar>
<paper-icon-button icon="menu" drawer-toggle></paper-icon-button>
<h4 condensed-title>iron-list <i>&mdash; Demo</i></h4>
<paper-icon-button icon="search"></paper-icon-button>
<paper-icon-button icon="more-vert"></paper-icon-button>
</app-toolbar>
<app-toolbar class="tall">
<h1 title>iron-list</h1>
</app-toolbar>
</app-header>

<!-- iron-list using the document scroll -->
<iron-list items="[[data]]" as="item" scroll-target="html">
<template>
<div>
<div class="item" tabindex$="[[tabIndex]]">
<iron-image class="avatar" sizing="contain" src="[[item.image]]"></iron-image>
<div class="pad">
<div class="primary">[[item.name]] [[index]]</div>
<div class="secondary">[[item.shortText]]</div>
<div class="secondary dim">[[item.longText]]</div>
</div>
</div>
</div>
</template>
</iron-list>

</template>

</body>
</html>
4 changes: 2 additions & 2 deletions demo/collapse.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<html>
<head>

<title>Collapsable items using iron-list</title>
<title>Collapsible items using iron-list</title>

<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no">
Expand Down Expand Up @@ -145,7 +145,7 @@
<iron-ajax url="data/contacts.json" last-response="{{items}}" auto></iron-ajax>

<app-toolbar>
<div title>Collapsable items</div>
<div title>Collapsible items</div>
<paper-icon-button icon="search" alt="Search"></paper-icon-button>
<paper-icon-button icon="more-vert" alt="More options"></paper-icon-button>
</app-toolbar>
Expand Down
170 changes: 24 additions & 146 deletions demo/index.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!--
@license
Copyright (c) 2015 The Polymer Project Authors. All rights reserved.
Copyright (c) 2016 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.txt
The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt
The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt
Expand All @@ -9,161 +9,39 @@
-->

<!doctype html>
<html id="html">
<html>
<head>

<title>iron-list demo</title>

<title>iron-list demos</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=no">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">

<meta name="viewport" content="width=device-width, minimum-scale=1.0, initial-scale=1, user-scalable=yes">
<script src="../../webcomponentsjs/webcomponents-lite.js"></script>

<link rel="import" href="../../polymer/polymer.html">
<link rel="import" href="../../iron-flex-layout/iron-flex-layout.html">
<link rel="import" href="../../app-layout/app-header/app-header.html">
<link rel="import" href="../../app-layout/app-toolbar/app-toolbar.html">
<link rel="import" href="../../app-layout/app-scroll-effects/app-scroll-effects.html">
<link rel="import" href="../../paper-icon-button/paper-icon-button.html">
<link rel="import" href="../../iron-ajax/iron-ajax.html">
<link rel="import" href="../../iron-icons/iron-icons.html">
<link rel="import" href="../../iron-image/iron-image.html">
<link rel="import" href="../iron-list.html">

<style is="custom-style">
body {
@apply(--layout-fullbleed);
font-family: 'Roboto', 'Noto', sans-serif;
background-color: #eee;
}

app-header {
position: fixed;
top: 0;
left: 0;
right: 0;
z-index: 1;
background-color: #0b8043;
color: white;
--app-header-background-front-layer: {
background-color: #4285f4;
};
}

app-header paper-icon-button {
--paper-icon-button-ink-color: white;
}

[title] {
font-weight: 400;
margin: 0 0 0 50px;
}

[condensed-title] {
font-weight: 400;
margin-left: 30px;
}

[condensed-title] i {
font-style: normal;
font-weight: 100;
}

app-toolbar.tall {
height: 148px;
}

iron-list {
padding-top: 148px;
margin-top: 64px;
padding-bottom: 16px;
<link rel="import" href="../../paper-styles/demo-pages.html">
<style>
a {
display: block;
margin-bottom: 10px;
}

.item {
@apply(--layout-horizontal);
padding: 20px;
border-radius: 8px;
background-color: white;
border: 1px solid #ddd;
max-width: 800px;
margin: 16px auto 0 auto;
li {
list-style: none;
}

.item:focus {
outline: 0;
border-color: #333;
}

.avatar {
height: 40px;
width: 40px;
border-radius: 20px;
box-sizing: border-box;
background-color: #DDD;
}

.pad {
padding: 0 16px;
@apply(--layout-flex);
@apply(--layout-vertical);
}

.primary {
font-size: 16px;
font-weight: bold;
}

.secondary {
font-size: 14px;
}

.dim {
color: gray;
}

.spacer {
@apply(--layout-flex);
}

</style>

</head>
<body unresolved>

<template is="dom-bind">
<iron-ajax url="data/contacts.json" last-response="{{data}}" auto></iron-ajax>

<app-header condenses fixed effects="resize-title blend-background waterfall">
<app-toolbar>
<paper-icon-button icon="menu" drawer-toggle></paper-icon-button>
<h4 condensed-title>iron-list <i>&mdash; Demo</i></h4>
<paper-icon-button icon="search"></paper-icon-button>
<paper-icon-button icon="more-vert"></paper-icon-button>
</app-toolbar>
<app-toolbar class="tall">
<h1 title>iron-list</h1>
</app-toolbar>
</app-header>

<!-- iron-list using the document scroll -->
<iron-list items="[[data]]" as="item" scroll-target="html">
<template>
<div>
<div class="item" tabindex$="[[tabIndex]]">
<iron-image class="avatar" sizing="contain" src="[[item.image]]"></iron-image>
<div class="pad">
<div class="primary">[[item.name]] [[index]]</div>
<div class="secondary">[[item.shortText]]</div>
<div class="secondary dim">[[item.longText]]</div>
</div>
</div>
</div>
</template>
</iron-list>

</template>
<div class="horizontal-section-container">
<div>
<h4>iron-list demos</h4>
<ul class="horizontal-section">
<li><a href="cards.html" target="_blank">List of cards</a></li>
<li><a href="collapse.html" target="_blank">Collapsible items</a></li>
<li><a href="scroll-threshold.html" target="_blank">Scroll thresholds</a></li>
<li><a href="grid.html" target="_blank">Grid layout</a></li>
<li><a href="selection.html" target="_blank">Contact selection</a></li>
<li><a href="basic.html" target="_blank">Basic list</a></li>
</ul>
</div>
</div>

</body>
</html>
Loading

0 comments on commit 57f8741

Please sign in to comment.