diff options
| author | Jules Laplace <jules@okfoc.us> | 2015-12-03 00:10:55 -0500 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2015-12-03 00:10:55 -0500 |
| commit | f78a20cc8a132ce317bb5d3dd36a0f39d8650cb8 (patch) | |
| tree | 8c4754f638c1cc2681e1fd0c7882d1ca1bda248d /StoneIsland/www/js | |
| parent | af6e0b66daec6100e7538fdcc269bc29588382fc (diff) | |
archiveview css
Diffstat (limited to 'StoneIsland/www/js')
| -rw-r--r-- | StoneIsland/www/js/lib/blogs/ArchiveView.js | 25 |
1 files changed, 18 insertions, 7 deletions
diff --git a/StoneIsland/www/js/lib/blogs/ArchiveView.js b/StoneIsland/www/js/lib/blogs/ArchiveView.js index ab27c824..785717a8 100644 --- a/StoneIsland/www/js/lib/blogs/ArchiveView.js +++ b/StoneIsland/www/js/lib/blogs/ArchiveView.js @@ -19,17 +19,22 @@ var ArchiveView = ScrollableView.extend({ this.$content = this.$(".content") this.$loader = this.$(".loader") this.scroller = new IScroll('#archive .scroll', app.iscroll_options) + this.$subtitle = this.$('.subtitle') + this.subtitle_html = this.$subtitle.html() + }, back: function(){ this.$el.addClass("menu") app.header.set_back(false) + this.$subtitle.html( this.subtitle_html ) }, pick: function(e){ this.$el.removeClass("menu") app.header.set_back(true) var index = $(e.currentTarget).data("index") + this.$subtitle.html( $(e.currentTarget).text() ) this.populateDecade(index) }, @@ -73,9 +78,8 @@ var ArchiveView = ScrollableView.extend({ count = count || row.images.length row.images.forEach(function(cell, i){ - if (i > 0) return var $t = $("<div>") - $t.addClass("row")// .addClass("loading") + $t.addClass("row").addClass("loading") var t = this.row_template.replace(/{{image}}/, cell.uri) .replace(/{{label}}/, cell.label) .replace(/{{code}}/, cell.code) @@ -91,7 +95,14 @@ var ArchiveView = ScrollableView.extend({ aa.flipped = true this.fix_z_index( aa ) + var $text = $t.find(".text") + if ( ($text.height() % 2) == 1) { + $text.css("margin-bottom", "1px") + } + loader.preloadImage(cell.uri, function(){ + aa.flipped = false + this.fix_z_index( aa ) $t.removeClass('loading') }.bind(this)) }.bind(this)) @@ -102,13 +113,13 @@ var ArchiveView = ScrollableView.extend({ touchstart: function(e){ app.archive.row = e.currentTarget - aa.mousedown(e.touches[0]) + app.archive.mousedown(e.touches[0]) }, touchmove: function(e){ - aa.mousemove(e.touches[0]) + app.archive.mousemove(e.touches[0]) }, touchend: function(e){ - aa.mouseup() + app.archive.mouseup() }, row: null, @@ -161,13 +172,13 @@ var ArchiveView = ScrollableView.extend({ render: function(aa, q){ if ( aa.flipped ) { gray = Math.round( (1-q) * 100 ) - opacity = lerp(q, 0.3, 1) + opacity = lerp(q, 0.2, 1) text_opacity = lerp(q, 1, 0.3) // console.log("<", gray, opacity) } else { gray = Math.round( q * 100 ) - opacity = lerp(q, 1, 0.3) + opacity = lerp(q, 1, 0.2) text_opacity = lerp(q, 0.3, 1) // console.log(">", gray, opacity) } |
