Sha256: 99d08d1a6ff7ff77d77ee6e5b215503b8703daddd48c0b6dbd42e12611b581d6
Contents?: true
Size: 1014 Bytes
Versions: 32
Compression:
Stored size: 1014 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.data('sending-form-message') || form.data('sending_form_message'); if (typeof(message) == 'undefined') message = form.find('input[type=submit]').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
32 entries across 32 versions & 2 rubygems