$(document). on('notifications:recount', function() { var menu = $('.notification-menu'); n = $('.notification', menu).not('.empty').length; $('.notification-count', menu).html(n>0 ? n : ''); }). on('ajax:success', 'form.new_authorized_key', function(e, data, status, xhr) { $(e.target).parents('.notification').eq(0).fadeOut('slow', function() { $('
Sorry, request failed.'); } error_div.show(); $($('input[name=disable_element]', e.target).val()). fadeTo(200, 1.0); }). on('click', 'form[data-remote] input[type=submit]', function(e) { $(e.target).parents('form').eq(0).parent().find('div.ajax-errors').html('').hide(); $($(e.target). parents('form'). find('input[name=disable_element]'). val()). fadeTo(200, 0.3); return true; });