~widelands-dev/widelands-website/django_staticfiles

« back to all changes in this revision

Viewing changes to media/js/disableOnSubmit.js

  • Committer: Holger Rapp
  • Date: 2016-08-08 10:06:42 UTC
  • mto: This revision was merged to the branch mainline in revision 419.
  • Revision ID: sirver@gmx.de-20160808100642-z62vwqitxoyl5fh4
Added the apt-get update script I run every 30 days.

Show diffs side-by-side

added added

removed removed

Lines of Context:
6
6
 */
7
7
$.fn.disableOnSubmit = function(disableList){
8
8
        
9
 
        if(disableList === null){var $list = 'input[type=submit],input[type=button],input[type=reset],button';}
 
9
        if(disableList == null){var $list = 'input[type=submit],input[type=button],input[type=reset],button';}
10
10
        else{var $list = disableList;}
11
11
        
12
12
        // Makes sure button is enabled at start
13
 
        $(this).find($list).prop("disabled", true);
 
13
        $(this).find($list).removeAttr('disabled');
14
14
        
15
15
        $(this).submit(function(){$(this).find($list).attr('disabled','disabled');});
16
16
        return this;