removing modal on default URL

This commit is contained in:
supercodepoet 2012-06-04 11:05:38 -05:00
parent 71b6237fc6
commit 6fe2e7edd4

View File

@ -24,9 +24,18 @@ $(function() {
var MainRouter = Backbone.Router.extend({ var MainRouter = Backbone.Router.extend({
routes: { routes: {
"": "checkModal",
"icon/:iconName": "showIcon" "icon/:iconName": "showIcon"
}, },
checkModal: function() {
var $modal = $("div.modal");
if ($modal.length > 0) {
$modal.modal("hide");
}
},
showIcon: function(iconName) { showIcon: function(iconName) {
var $modal = $(mainView.modalTemplate({"iconName": iconName})); var $modal = $(mainView.modalTemplate({"iconName": iconName}));