diff options
| author | Jules Laplace <jules@okfoc.us> | 2016-04-07 19:04:06 -0400 |
|---|---|---|
| committer | Jules Laplace <jules@okfoc.us> | 2016-04-07 19:04:06 -0400 |
| commit | 4d1fd1f42458806c2bef055d20f300644ae14542 (patch) | |
| tree | 77d509c4a678eb08e94a3ea4c10bfd0c99b74e32 /public/assets/js/lib | |
| parent | 2eb75fafd9c2369a086095016a605424ef49bae0 (diff) | |
reset view immediately frm nav
Diffstat (limited to 'public/assets/js/lib')
| -rw-r--r-- | public/assets/js/lib/NavView.js | 6 | ||||
| -rw-r--r-- | public/assets/js/lib/ProjectView.js | 21 |
2 files changed, 17 insertions, 10 deletions
diff --git a/public/assets/js/lib/NavView.js b/public/assets/js/lib/NavView.js index ce231b8..1657f91 100644 --- a/public/assets/js/lib/NavView.js +++ b/public/assets/js/lib/NavView.js @@ -24,7 +24,11 @@ var NavView = View.extend({ click: function(e){ var id = $(e.target).closest("li").data("id") console.log("PICK", id) - this.pick(id) + var view = app.lookup[ id ] + if (view !== app.view) { + app.view.reset() + this.swap( view, "down" ) + } }, pick: function(id){ diff --git a/public/assets/js/lib/ProjectView.js b/public/assets/js/lib/ProjectView.js index 2bb0f32..7749908 100644 --- a/public/assets/js/lib/ProjectView.js +++ b/public/assets/js/lib/ProjectView.js @@ -117,18 +117,21 @@ var ProjectView = View.extend({ hide: function(){ addClassForPeriod( this.el, "hiding", app.navigation_delay, function(){ - this.$el.addClass("hidden") - this.$el.removeClass("active") - - this.$images.each(function(){ - $(this).css("background-image", "") - }) - this.$iframes.html("") - this.$videos.html("") - + this.reset() }.bind(this) ) }, + reset: function(){ + this.$el.addClass("hidden") + this.$el.removeClass("active") + + this.$images.each(function(){ + $(this).css("background-image", "") + }) + this.$iframes.html("") + this.$videos.html("") + }, + previous: function(e){ if (is_mobile) return; e.stopPropagation() |
