rewrite admin.js in coffeescript
This commit is contained in:
parent
c106bb7096
commit
60e18e2636
2 changed files with 8 additions and 11 deletions
|
@ -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');
|
||||
}
|
||||
});
|
||||
});
|
8
app/assets/javascripts/admin.js.coffee
Normal file
8
app/assets/javascripts/admin.js.coffee
Normal 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'
|
Loading…
Add table
Reference in a new issue