rewrite admin.js in coffeescript

This commit is contained in:
Nihad Abbasov 2012-09-06 04:32:01 -07:00
parent c106bb7096
commit 60e18e2636
2 changed files with 8 additions and 11 deletions

View file

@ -1,11 +0,0 @@
$(document).ready(function(){
$('input#user_force_random_password').on('change', function(elem) {
var elems = $('#user_password, #user_password_confirmation');
if ($(this).attr('checked')) {
elems.val('').attr('disabled', true);
} else {
elems.removeAttr('disabled');
}
});
});

View file

@ -0,0 +1,8 @@
$ ->
$('input#user_force_random_password').on 'change', (elem) ->
elems = $('#user_password, #user_password_confirmation')
if $(@).attr 'checked'
elems.val('').attr 'disabled', true
else
elems.removeAttr 'disabled'