Sha256: ca02e2053b0f2419fd3407c9380c3ab5710c0c09f722d740198606abbf6844cd
Contents?: true
Size: 987 Bytes
Versions: 5
Compression:
Stored size: 987 Bytes
Contents
/** * Version 0.0.1 * Display a message letting the user know the form is being submitted * Didier Lafforgue */ $.fn.formSubmitNotification = function(settings) { function show() { $('#form-submit-notification').fadeIn() } function hide() { $('#form-submit-notification').fadeOut() } function create(message) { if ($('#form-submit-notification').size() == 0) { var element = $("<div id=\"form-submit-notification\"><div>" + message + "</div></div>").hide(); $('body').append(element); } } return this.each(function() { var form = $(this); var message = form.attr('data-sending-form-message'); if (typeof(message) == 'undefined') message = form.find('input[type=submit]').attr('data-sending-form-message'); if (typeof(message) == 'undefined') return ; create(message); form.bind('ajax:beforeSend', function(event) { show() }); form.bind('ajax:complete', function(event) { hide() }); }); }
Version data entries
5 entries across 5 versions & 1 rubygems