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.js27
1 files changed, 9 insertions, 18 deletions
diff --git a/public/assets/js/app.js b/public/assets/js/app.js
index 319a939..040b99c 100644
--- a/public/assets/js/app.js
+++ b/public/assets/js/app.js
@@ -18,8 +18,8 @@ var app = (function() {
}
app.init = function() {
- app.bind()
app.build()
+ app.bind()
app.ready()
}
@@ -28,20 +28,25 @@ var app = (function() {
document.addEventListener('touchmove', function(e) {
e.preventDefault()
})
- FastClick.attach(document.body)
+ window.FastClick && FastClick.attach(document.body)
}
$(window).resize(app.resize)
}
app.build = function(data) {
+ app.loader = new Loader ()
app.header = new HeaderView()
app.nav = new NavView()
- var items = $(".item")
+ // should this go here or elsewhere?
+ app.resizeItems()
+
+ var $items = $(".item")
+
app.lookup = {}
- app.projects = items.toArray().map(function(el, i){
+ app.projects = $items.toArray().map(function(el, i){
var view = new ProjectView ({
el: el,
page_number: i,
@@ -63,7 +68,6 @@ var app = (function() {
gallery && gallery.next()
},
})
-
}
app.ready = function() {
@@ -123,17 +127,4 @@ var app = (function() {
})()
-app.resizeItems()
-
-$('.top').each(function(){
- if ($(this).find(".cell").length > 1) {
- $(this).flickity(app.flickity_options).on( 'cellSelect', function(e) {
- var gallery = $(e.target).data('flickity')
- app.header.updateSlideNumber( gallery.selectedIndex )
- })
- }
-})
-
-$(".item").addClass("hidden")
-
app.init()