diff app/assets/javascripts/pastes.js @ 39:a930c717654c

Add Clear button to the form.
author Edho Arief <edho@myconan.net>
date Thu, 04 Oct 2012 02:08:11 +0700
parents 42de15334db1
children 6a9e0c09bbd8
line wrap: on
line diff
--- a/app/assets/javascripts/pastes.js	Thu Oct 04 01:57:13 2012 +0700
+++ b/app/assets/javascripts/pastes.js	Thu Oct 04 02:08:11 2012 +0700
@@ -1,2 +1,10 @@
 // Place all the behaviors and hooks related to the matching controller here.
 // All this logic will automatically be available in application.js.
+
+$(document).ready(function() {
+  $('#reset_paste').click(function() {
+    $('#paste_paste').val('');
+    $('#paste_paste').focus();
+    return false;
+  });
+})