Added 'date' to output
Signed-off-by: James Ketrenos <james_git@ketrenos.com>
This commit is contained in:
parent
6d234bdbc4
commit
0aed7f2293
@ -73,6 +73,12 @@
|
|||||||
overflow-y: hidden !important;
|
overflow-y: hidden !important;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.date-line {
|
||||||
|
display: block;
|
||||||
|
padding: 0.5em 0;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
<app-location route="{{route}}"></app-location>
|
<app-location route="{{route}}"></app-location>
|
||||||
@ -85,10 +91,7 @@
|
|||||||
<div>[[path]]</div>
|
<div>[[path]]</div>
|
||||||
</app-header>
|
</app-header>
|
||||||
<div id="content">
|
<div id="content">
|
||||||
<div class="thumbnails layout horizontal wrap">
|
<div id="thumbnails" class="thumbnails layout horizontal wrap">
|
||||||
<template is="dom-repeat" items="[[photos]]">
|
|
||||||
<photo-thumbnail width="[[calcWidth]]" on-tap="_imageTap" item="[[item]]"></photo-thumbnail>
|
|
||||||
</template>
|
|
||||||
</div>
|
</div>
|
||||||
<div id="magic"></div>
|
<div id="magic"></div>
|
||||||
<div class="layout horizontal">
|
<div class="layout horizontal">
|
||||||
@ -124,8 +127,16 @@
|
|||||||
},
|
},
|
||||||
|
|
||||||
observers: [
|
observers: [
|
||||||
|
"widthChanged(calcWidth)"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
widthChanged: function(calcWidth) {
|
||||||
|
var thumbs = this.$.thumbnails.querySelectorAll("photo-thumbnail");
|
||||||
|
Array.prototype.forEach.call(thumbs, function(thumb) {
|
||||||
|
thumb.width = calcWidth;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
behaviors: [
|
behaviors: [
|
||||||
/* @polymerBehavior Polymer.IronResizableBehavior */
|
/* @polymerBehavior Polymer.IronResizableBehavior */
|
||||||
Polymer.IronResizableBehavior
|
Polymer.IronResizableBehavior
|
||||||
@ -210,10 +221,25 @@
|
|||||||
this.base = "";
|
this.base = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (append) {
|
|
||||||
results.items.forEach(function(photo) {
|
results.items.forEach(function(photo) {
|
||||||
this.push("photos", photo);
|
var thumbnail = document.createElement("photo-thumbnail");
|
||||||
|
thumbnail.item = photo;
|
||||||
|
thumbnail.width = this.calcWidth;
|
||||||
|
thumbnail.addEventListener("click", this._imageTap.bind(this));
|
||||||
|
var datetime = (photo.taken || photo.modified || photo.added).replace(/T.*$/, "");
|
||||||
|
if (this.lastDate != datetime) {
|
||||||
|
var dateLine = document.createElement("div");
|
||||||
|
dateLine.classList.add("date-line");
|
||||||
|
dateLine.textContent = datetime;
|
||||||
|
this.lastDate = datetime;
|
||||||
|
Polymer.dom(this.$.thumbnails).appendChild(dateLine);
|
||||||
|
}
|
||||||
|
|
||||||
|
Polymer.dom(this.$.thumbnails).appendChild(thumbnail);
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
|
|
||||||
|
if (append) {
|
||||||
|
this.photos = this.photos.concat(results.items);
|
||||||
} else {
|
} else {
|
||||||
this.photos = results.items;
|
this.photos = results.items;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user