summaryrefslogtreecommitdiff
path: root/public/assets/js/app.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2016-04-04 14:12:38 -0400
committerJules Laplace <jules@okfoc.us>2016-04-04 14:12:38 -0400
commitd1714eb9c50ebacc12431fe08122764397106013 (patch)
tree1e8a03619137e119645bf8e8d15e61169259c151 /public/assets/js/app.js
parentbc5c9ff05b113df0907f442c225ce61c3f15f1b3 (diff)
making mobile work better
Diffstat (limited to 'public/assets/js/app.js')
-rw-r--r--public/assets/js/app.js18
1 files changed, 13 insertions, 5 deletions
diff --git a/public/assets/js/app.js b/public/assets/js/app.js
index 040b99c..91ccdaf 100644
--- a/public/assets/js/app.js
+++ b/public/assets/js/app.js
@@ -40,13 +40,12 @@ var app = (function() {
app.header = new HeaderView()
app.nav = new NavView()
- // should this go here or elsewhere?
- app.resizeItems()
+ app.$items = $(".item")
- var $items = $(".item")
+ app.resizeItems()
app.lookup = {}
- app.projects = $items.toArray().map(function(el, i){
+ app.projects = app.$items.toArray().map(function(el, i){
var view = new ProjectView ({
el: el,
page_number: i,
@@ -98,11 +97,20 @@ var app = (function() {
}
app.resizeItems = function(){
+ var windowHeight = window.innerHeight
+
+ if (is_iphone) {
+ windowHeight -= 44 // account for lower bar
+ window.scrollTo(0,0)
+ }
+
$(".item").each(function(i){
- var height = window.innerHeight - ($(this).find(".bottom").height() + 10)
+
+ var height = windowHeight - ($(this).find(".bottom").height() + 10)
if (is_desktop) {
height -= $("nav").height() // account for top bar
}
+
$(".cell, .top, .previous, .next, .flickity-viewport", this).css({ 'height': height })
var cellCount = $(this).find(".cell").length
if ($.browser.mozilla) {