diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-03-30 13:31:21 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-03-30 13:31:21 -0400 |
| commit | ac14d77fdb071828806bebf1920e1b150f3c6359 (patch) | |
| tree | e38ed941cf924f332261165ce4f06cb972c21d68 /public/assets/js | |
| parent | 42ca8182e820d95e939321bf027886824b25624d (diff) | |
heights
Diffstat (limited to 'public/assets/js')
| -rw-r--r-- | public/assets/js/app.js | 15 | ||||
| -rw-r--r-- | public/assets/js/lib/ProjectView.js | 14 |
2 files changed, 22 insertions, 7 deletions
diff --git a/public/assets/js/app.js b/public/assets/js/app.js index eff6dab..c21ed73 100644 --- a/public/assets/js/app.js +++ b/public/assets/js/app.js @@ -27,7 +27,7 @@ var app = (function() { document.addEventListener('touchmove', function(e) { e.preventDefault() }) - // FastClick.attach(document.body) + FastClick.attach(document.body) } $(window).resize(app.resize) @@ -70,7 +70,11 @@ var app = (function() { setTimeout(function(){ $(".item").each(function(i){ var height = window.innerHeight - $(this).find(".bottom").height() + if (is_desktop) { + height -= $("nav").height() // account for top bar + } $(".previous, .next, .cell, .top, .flickity-viewport", this).css({ 'height': height }) + $(".bottom", this).css({ 'top': height }) }) app.view.$el.removeClass("hidden") // $('.top').flickity('resize') @@ -84,8 +88,12 @@ var app = (function() { })() $(".item").each(function(i){ - var height = window.innerHeight - $(this).find(".bottom").height() + var height = window.innerHeight - ($(this).find(".bottom").height() + 10) + if (is_desktop) { + height -= $("nav").height() // account for top bar + } $(".cell, .top", this).css({ 'height': height }) + $(".bottom", this).css({ 'top': height + 20 }) }) $('.top').each(function(){ @@ -99,6 +107,9 @@ $('.top').each(function(){ $(".item").each(function(i){ var height = window.innerHeight - $(this).find(".bottom").height() + if (is_desktop) { + height -= $("nav").height() // account for top bar + } $(".previous, .next, .flickity-viewport", this).css({ 'height': height }) }) diff --git a/public/assets/js/lib/ProjectView.js b/public/assets/js/lib/ProjectView.js index 575174b..061dcee 100644 --- a/public/assets/js/lib/ProjectView.js +++ b/public/assets/js/lib/ProjectView.js @@ -17,14 +17,18 @@ var ProjectView = View.extend({ if (! $viewport.length) { $viewport = this.$(".cell") } - if (! $viewport.length) { - this.$(".top").append( $("<div>").addClass("page-up") ) - this.$(".top").append( $("<div>").addClass("page-down") ) - } - else { + if ($viewport.length) { $("<div>").addClass("page-up").insertAfter( $viewport ) $("<div>").addClass("page-down").insertAfter( $viewport ) } + else if (this.$('.top').length) { + this.$(".top").append( $("<figure>").addClass("page-up") ) + this.$(".top").append( $("<figure>").addClass("page-down") ) + } + else { + this.$el.append( $("<figure>").addClass("page-up") ) + this.$el.append( $("<figure>").addClass("page-down") ) + } }, show: function(){ |
