Maildog.Views.EmailFolders = Backbone.CompositeView.extend({
  template: JST['emailFolders'],
  tagName: "li",

  events: {
    "click .compose-button": "popUpComposeEmailBox",
    "click #inbox-folder": "routeToInbox",
    "click #starred-folder": "routeToStarred",
    "click #sent-folder": "routeToSent",
    "click #drafts-folder": "routeToDrafts",
    "click #trash-folder": "routeToTrash",
  },

  render: function() {
    this.$el.html(this.template());
    return this;
  },

  routeToInbox: function() {
    Backbone.history.loadUrl("#inbox");
  },

  routeToStarred: function() {
    Backbone.history.loadUrl("#starred");
  },

  routeToSent: function() {
    Backbone.history.loadUrl("#sent");
  },

  routeToDrafts: function() {
    Backbone.history.loadUrl("#drafts");
  },

  routeToTrash: function() {
    Backbone.history.loadUrl("#trash");
  },

  popUpComposeEmailBox: function() {
    Maildog.router.removeFlashes();
    var view = new Maildog.Views.ComposeEmailBox();
    this.addSubview('.compose-email-popup-container', view, true);
    $('.compose-email-popup-to').focus();
  }
});

@@ -514,347 +514,1051 @@
     
-Backbone.history.loadUrl(%22#inbox%22);%0A  %7D,%0A%0A  routeToStarred: function() %7B%0A    Backbone.history.loadUrl(%22#starred%22);%0A  %7D,%0A%0A  routeToSent: function() %7B%0A    Backbone.history.loadUrl(%22#sent%22);%0A  %7D,%0A%0A  routeToDrafts: function() %7B%0A    Backbone.history.loadUrl(%22#drafts%22);%0A  %7D,%0A%0A  routeToTrash: function() %7B%0A    Backbone.history.loadUrl(%22#trash%22);
+if (Backbone.history.getFragment() === %22inbox%22) %7B%0A      Backbone.history.loadUrl(%22#inbox%22);%0A    %7D%0A    else %7B%0A      Backbone.history.navigate(%22inbox%22, %7B trigger: true %7D);%0A    %7D%0A  %7D,%0A%0A  routeToStarred: function() %7B%0A    if (Backbone.history.getFragment() === %22starred%22) %7B%0A      Backbone.history.loadUrl(%22#starred%22);%0A    %7D%0A    else %7B%0A      Backbone.history.navigate(%22starred%22, %7B trigger: true %7D);%0A    %7D%0A  %7D,%0A%0A  routeToSent: function() %7B%0A    if (Backbone.history.getFragment() === %22sent%22) %7B%0A      Backbone.history.loadUrl(%22#sent%22);%0A    %7D%0A    else %7B%0A      Backbone.history.navigate(%22sent%22, %7B trigger: true %7D);%0A    %7D%0A  %7D,%0A%0A  routeToDrafts: function() %7B%0A    if (Backbone.history.getFragment() === %22drafts%22) %7B%0A      Backbone.history.loadUrl(%22#drafts%22);%0A    %7D%0A    else %7B%0A      Backbone.history.navigate(%22drafts%22, %7B trigger: true %7D);%0A    %7D%0A  %7D,%0A%0A  routeToTrash: function() %7B%0A    if (Backbone.history.getFragment() === %22trash%22) %7B%0A      Backbone.history.loadUrl(%22#trash%22);%0A    %7D%0A    else %7B%0A      Backbone.history.navigate(%22trash%22, %7B trigger: true %7D);%0A    %7D
 %0A  %7D

fix routing from folder clicks