summaryrefslogtreecommitdiff
path: root/public/assets/js/app.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/assets/js/app.js')
-rw-r--r--public/assets/js/app.js36
1 files changed, 27 insertions, 9 deletions
diff --git a/public/assets/js/app.js b/public/assets/js/app.js
index eff6dab..fa5dafe 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)
@@ -68,25 +68,40 @@ var app = (function() {
debounce(function() {
$(".active.item").addClass("hidden")
setTimeout(function(){
- $(".item").each(function(i){
- var height = window.innerHeight - $(this).find(".bottom").height()
- $(".previous, .next, .cell, .top, .flickity-viewport", this).css({ 'height': height })
- })
+ app.resizeItems()
app.view.$el.removeClass("hidden")
// $('.top').flickity('resize')
$('body').removeClass('resizing')
}, 400)
}, 400)
}
+
+ app.resizeItems = function(){
+ $(".item").each(function(i){
+ var height = window.innerHeight - ($(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 (cellCount == 0) {
+ console.log($(this).data("id"), "NONE")
+ $(".bottom", this).css({ 'top': height + 17 })
+ }
+ else if (cellCount == 1) {
+ $(".bottom", this).css({ 'top': height + 13 })
+ }
+ else {
+ $(".bottom", this).css({ 'top': height + 19 })
+ }
+ })
+ }
return app
})()
-$(".item").each(function(i){
- var height = window.innerHeight - $(this).find(".bottom").height()
- $(".cell, .top", this).css({ 'height': height })
-})
+app.resizeItems()
$('.top').each(function(){
if ($(this).find(".cell").length > 1) {
@@ -99,6 +114,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 })
})