diff --git a/frontend/src/ketr-photos/ketr-photos.html b/frontend/src/ketr-photos/ketr-photos.html index 3077143..362938f 100755 --- a/frontend/src/ketr-photos/ketr-photos.html +++ b/frontend/src/ketr-photos/ketr-photos.html @@ -47,18 +47,22 @@
time
-
Photos taken on [[memoryDate]], regardless of year.
+
Photos taken on [[memoryDate]]
@@ -342,6 +376,18 @@ "dateChanged(date)" ], + isToday: function(date) { + return this.date == "2016-" + window.moment().format("MM-DD"); + }, + + gotoToday: function() { + this.date = "2016-" + window.moment().format("MM-DD"); + }, + + gotoRandomDay: function() { + this.date = "2016-" + window.moment(Math.ceil(Math.random() * 365), "DDD").format("MM-DD"); + }, + shouldShowAlbums: function(order) { return order == "by-album"; }, @@ -353,15 +399,21 @@ } }, - dateChanged: function(date) { + resetPhotos: function() { this.years = []; + this.notifyPath("years.length"); this.pendingPhotos = []; this.visibleThumbs = []; this.thumbnails = []; + this.notifyPath("thumbnails.length"); this.cursor = null; Polymer.dom(this.$.thumbnails).innerHTML = ""; this.next = false; this.limit = undefined; + }, + + dateChanged: function(date) { + this.resetPhotos(); this.memoryDate = window.moment(this.date).format("MMMM Do"); this._loadPhotos(); }, @@ -369,13 +421,7 @@ modeChanged: function(mode) { console.log("Mode changed to " + mode); this.path = ""; - this.pendingPhotos = []; - this.visibleThumbs = []; - this.thumbnails = []; - this.cursor = null; - Polymer.dom(this.$.thumbnails).innerHTML = ""; - this.next = false; - this.limit = undefined; + this.resetPhotos(); this._loadPhotos(); }, @@ -423,13 +469,7 @@ _pathLoad: function(path) { this.path = path; - this.pendingPhotos = []; - this.visibleThumbs = []; - this.thumbnails = []; - this.cursor = null; - Polymer.dom(this.$.thumbnails).innerHTML = ""; - this.next = false; - this.limit = undefined; + this.resetPhotos(); this._loadAlbums(); this._loadPhotos(); },