diff app/assets/javascripts/init.tabs.js @ 123:5b58b0d6841c

Use hashbang instead of plain hash.
author Edho Arief <edho@myconan.net>
date Mon, 12 Nov 2012 15:27:10 +0700
parents a836cfe4092f
children 4a8cefa814f1
line wrap: on
line diff
--- a/app/assets/javascripts/init.tabs.js	Mon Nov 12 15:21:01 2012 +0700
+++ b/app/assets/javascripts/init.tabs.js	Mon Nov 12 15:27:10 2012 +0700
@@ -14,9 +14,9 @@
       var paste = $('#paste'),
         mode = paste.data('mode'),
         width = paste.data('width'),
-        qstring = '#' + mode + '.' + width;
+        qstring = '#!' + mode + '.' + width;
       if (width == 'auto') {
-        qstring = '#';
+        qstring = '#!';
         if (mode != 'plain') {
           qstring += mode;
         }
@@ -48,7 +48,7 @@
       return false;
     });
 
-    mode = window.location.hash.substr(1).split('.');
+    mode = window.location.hash.substr(2).split('.');
     if (mode[0] == 'highlight') { $('#paste-tabs li:eq(1) a').click(); }
     else if (mode[0] == 'markdown') { $('#paste-tabs li:eq(2) a').click(); }
     if (mode[1] && mode[1].match(/^\d+px$/)) { paste_resize(mode[1]); }