diff app/assets/javascripts/init.tabs.js @ 111:a92e732a2caa

Correct way to switch tab.
author Edho Arief <edho@myconan.net>
date Mon, 12 Nov 2012 12:35:33 +0700
parents e8c632b0eb80
children 2b1041e8c35e
line wrap: on
line diff
--- a/app/assets/javascripts/init.tabs.js	Mon Nov 12 12:31:43 2012 +0700
+++ b/app/assets/javascripts/init.tabs.js	Mon Nov 12 12:35:33 2012 +0700
@@ -8,8 +8,8 @@
     $('#markdown div').html(marked(raw));
 
     mode = window.location.hash.substr(1);
-    if (mode == 'highlight') { $('#paste-tabs li:eq(1) a').click(); }
-    else if (mode == 'markdown') { $('#paste-tabs li:eq(2) a').click(); }
+    if (mode == 'highlight') { $('#paste-tabs li:eq(1) a').tab('show'); }
+    else if (mode == 'markdown') { $('#paste-tabs li:eq(2) a').tab('show'); }
 
     $('#tab-resize ul a').click(function() {
       var size = $(this).data('size'),