I have a three backbone routes
routes: {
"foo": "foo",
"": "foo",
"foo/bar": "bar",
"foo/baz": "baz"
},
foo: function () {
var fooView = new contentCollectionView({
collection: collection,
tagName: "div",
className: "foo"
});
fooView.close();
FOO.content.show(fooView);
},
bar: function(){
this.foo();
...
},
baz: function(){
this.foo();
...
}
});
With bar and baz functions I would really like to only run foo if fooView is not currently shown, otherwise the only thing they do is to change a css class that changes how foo is displayed.