diff app/assets/javascripts/pastes.js @ 78:6ae3333a0251

Moved out link click listener from $(document).ready.
author Edho Arief <edho@myconan.net>
date Sun, 07 Oct 2012 16:05:30 +0700
parents 5635c91f4bfd
children 50b8738d6428
line wrap: on
line diff
--- a/app/assets/javascripts/pastes.js	Thu Oct 04 10:49:23 2012 -0700
+++ b/app/assets/javascripts/pastes.js	Sun Oct 07 16:05:30 2012 +0700
@@ -1,11 +1,11 @@
 // Place all the behaviors and hooks related to the matching controller here.
 // All this logic will automatically be available in application.js.
 
+$(document).on('click', '#reset_paste', function() {
+  $('#paste_paste').val('');
+  $('#paste_paste').focus();
+  return false;
+});
 $(document).ready(function() {
-  $('#reset_paste').click(function() {
-    $('#paste_paste').val('');
-    $('#paste_paste').focus();
-    return false;
-  });
   $('#paste_paste').focus();
 })