summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--public/assets/js/app.js12
-rw-r--r--public/assets/js/lib/NavView.js3
-rw-r--r--public/assets/js/lib/ProjectView.js7
-rw-r--r--templates/index.liquid4
4 files changed, 24 insertions, 2 deletions
diff --git a/public/assets/js/app.js b/public/assets/js/app.js
index aa6fef6..13017f6 100644
--- a/public/assets/js/app.js
+++ b/public/assets/js/app.js
@@ -23,6 +23,13 @@ var app = (function() {
}
app.build = function(data) {
+ var items = $(".item")
+ app.lookup = {}
+ app.projects = items.toArray().map(function(el){
+ var view = new ProjectView ({ el: el })
+ app.lookup[ view.project_id ] = view
+ return view
+ })
app.nav = new NavView()
}
@@ -30,7 +37,10 @@ var app = (function() {
setTimeout(function(){
$("body").removeClass("loading")
}, 20)
- app.view = null
+
+ app.view = app.projects[0]
+ app.view.show()
+
console.log("launched")
}
diff --git a/public/assets/js/lib/NavView.js b/public/assets/js/lib/NavView.js
index 110e1fb..1edca02 100644
--- a/public/assets/js/lib/NavView.js
+++ b/public/assets/js/lib/NavView.js
@@ -1,2 +1,5 @@
var NavView = View.extend({
+
+
+
}) \ No newline at end of file
diff --git a/public/assets/js/lib/ProjectView.js b/public/assets/js/lib/ProjectView.js
index ef03094..f5e47bd 100644
--- a/public/assets/js/lib/ProjectView.js
+++ b/public/assets/js/lib/ProjectView.js
@@ -5,6 +5,13 @@ var ProjectView = View.extend({
initialize: function(opt){
this.gallery = new GalleryView ()
+ this.project_id = this.$el.data("id")
+ },
+
+ show: function(){
+ },
+
+ hide: function(){
},
})
diff --git a/templates/index.liquid b/templates/index.liquid
index bba8945..1cda53b 100644
--- a/templates/index.liquid
+++ b/templates/index.liquid
@@ -74,7 +74,7 @@
{% endif %}
{% endfor %}
</div>
- <div class="bottom {% if project.press %}press{% else %}nopress{% endif %}">
+ <div class="bottom {% if project.press.length %}press{% else %}nopress{% endif %}">
<div class="headings five">
<span>YEAR</span>
<span>CLIENT</span>
@@ -100,6 +100,7 @@
<span class="description">
{{ project.brief }}
</span>
+ {% if project.press.length %}
<span>
<ul>
{% for link in project.press %}
@@ -109,6 +110,7 @@
{% endfor %}
</ul>
</span>
+ {% endif %}
</div>
</div>
</div>