diff options
Diffstat (limited to 'app/assets/javascripts/admin')
-rw-r--r-- | app/assets/javascripts/admin/init_ckeditor.coffee | 6 | ||||
-rw-r--r-- | app/assets/javascripts/admin/records.coffee | 9 |
2 files changed, 15 insertions, 0 deletions
diff --git a/app/assets/javascripts/admin/init_ckeditor.coffee b/app/assets/javascripts/admin/init_ckeditor.coffee new file mode 100644 index 0000000..5f653af --- /dev/null +++ b/app/assets/javascripts/admin/init_ckeditor.coffee | |||
@@ -0,0 +1,6 @@ | |||
1 | ready = -> | ||
2 | $('.ckeditor').each -> | ||
3 | CKEDITOR.replace $(this).attr('id') | ||
4 | |||
5 | $(document).ready(ready) | ||
6 | $(document).on('page:load', ready) | ||
diff --git a/app/assets/javascripts/admin/records.coffee b/app/assets/javascripts/admin/records.coffee new file mode 100644 index 0000000..69cd471 --- /dev/null +++ b/app/assets/javascripts/admin/records.coffee | |||
@@ -0,0 +1,9 @@ | |||
1 | # Place all the behaviors and hooks related to the matching controller here. | ||
2 | # All this logic will automatically be available in application.js. | ||
3 | # You can use CoffeeScript in this file: http://coffeescript.org/ | ||
4 | $(document).on "turbolinks:load", -> | ||
5 | $(".should-create-record-field input[type=checkbox]").change -> | ||
6 | if $(".should-create-record-field input[type=checkbox]").prop("checked") | ||
7 | $(".record-description-field").show() | ||
8 | else | ||
9 | $(".record-description-field").hide() | ||