diff app/assets/javascripts/form_clear_main.coffee @ 395:26f8c634052c

Complete rework.
author nanaya <me@myconan.net>
date Sat, 27 Jun 2015 14:46:01 +0900
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/app/assets/javascripts/form_clear_main.coffee	Sat Jun 27 14:46:01 2015 +0900
@@ -0,0 +1,5 @@
+$(document).on "click", ".js-form-main-clear", (e) ->
+  e.preventDefault()
+  $(e.target).parents("form").find(".js-form-main")
+    .val("")
+    .focus()