diff app/assets/javascripts/init.tabs.js @ 131:7c7601575358

Moved $('#markdown div') to variable.
author Edho Arief <edho@myconan.net>
date Mon, 12 Nov 2012 17:27:14 +0700
parents 64523785ad24
children e05e47f7d224
line wrap: on
line diff
--- a/app/assets/javascripts/init.tabs.js	Mon Nov 12 17:25:47 2012 +0700
+++ b/app/assets/javascripts/init.tabs.js	Mon Nov 12 17:27:14 2012 +0700
@@ -2,11 +2,12 @@
   if ($('#paste-show').length !== 1) {
     return;
   }
-  raw = $('#plain pre').text();
+  var raw = $('#plain pre').text(),
+    markdown = $('#markdown div');
 
-  $('#markdown div').html(marked(raw));
-  $('#markdown div pre').addClass('prettyprint');
-  $('#markdown div a').prop('rel', 'nofollow');
+  markdown.html(marked(raw));
+  markdown.find('pre').addClass('prettyprint');
+  markdown.find('a').prop('rel', 'nofollow');
 
   $('#highlight pre').text(raw);