This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Bug fix (if invalid location hash is used)

  • Loading branch information...
dmfrancisco committed Jul 1, 2011
1 parent 8b73c91 commit 07e179648ca9c140b4cc633eea637ce27103b2e1
Showing with 13 additions and 3 deletions.
  1. +13 −3 public/js/script.js
View
@@ -255,14 +255,24 @@ function initTipsy() {
}
function changeSelectedLanguage(lang) {
- if (lang === "") lang = "textile";
-
$('.language').each(function() {
$(this).text($(this).text().replace('', ''));
})
- $("#language-"+ lang).append("");
renderMode = lang;
+ switch (lang)
+ {
+ case "plain":
+ renderMode = "plain";
+ break;
+ case "markdown":
+ renderMode = "markdown";
+ break;
+ case "textile":
+ default:
+ renderMode = "textile";
+ }
+ $("#language-"+ renderMode).append("");
window.location.hash = renderMode;
}

0 comments on commit 07e1796

Please sign in to comment.