Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

fixing issue reported where direct linking to level 3 doesnt remove f…

…allbacks
  • Loading branch information...
commit a3f51f7f3a00bc17f10e59546977a9c0b40697a5 1 parent 4c9a295
@addyosmani authored
Showing with 10 additions and 3 deletions.
  1. +10 −3 gallery.js
View
13 gallery.js
@@ -25,6 +25,13 @@ var PhotoCollection = Backbone.Collection.extend({
}
});
+function removeFallbacks(){
+ var query = $('.jstest,.gallery');
+ if(query.length){
+ query.remove();
+ }
+}
+
/**
* IndexView: The default view seen when opening up the application for the first time. This
@@ -38,7 +45,7 @@ var IndexView = Backbone.View.extend({
indexTemplate: $("#indexTmpl").template(),
render: function() {
- $('.jstest,.gallery').remove();
+ removeFallbacks();
var sg = this;
this.el.fadeOut('fast', function() {
@@ -68,7 +75,7 @@ var SubalbumView = Backbone.View.extend({
render: function() {
var sg = this;
-
+ removeFallbacks();
this.el.fadeOut('fast', function() {
sg.el.empty();
$.tmpl(sg.indexTemplate, sg.model.toArray()).appendTo(sg.el);
@@ -98,7 +105,7 @@ var PhotoView = Backbone.View.extend({
render: function() {
var sg = this;
-
+ removeFallbacks();
this.el.fadeOut('fast', function() {
sg.el.empty();
$.tmpl(sg.itemTemplate, sg.model).appendTo(sg.el);
Please sign in to comment.
Something went wrong with that request. Please try again.