Commit 60e18e2636b8ca3e6f25c5a9adaa4118f5a2d3ad

Authored by Nihad Abbasov
1 parent c106bb70

rewrite admin.js in coffeescript

app/assets/javascripts/admin.js
... ... @@ -1,11 +0,0 @@
1   -$(document).ready(function(){
2   - $('input#user_force_random_password').on('change', function(elem) {
3   - var elems = $('#user_password, #user_password_confirmation');
4   -
5   - if ($(this).attr('checked')) {
6   - elems.val('').attr('disabled', true);
7   - } else {
8   - elems.removeAttr('disabled');
9   - }
10   - });
11   -});
app/assets/javascripts/admin.js.coffee 0 → 100644
... ... @@ -0,0 +1,8 @@
  1 +$ ->
  2 + $('input#user_force_random_password').on 'change', (elem) ->
  3 + elems = $('#user_password, #user_password_confirmation')
  4 +
  5 + if $(@).attr 'checked'
  6 + elems.val('').attr 'disabled', true
  7 + else
  8 + elems.removeAttr 'disabled'
... ...