Welcome to mirror list, hosted at ThFree Co, Russian Federation.

jquery.js « extensions « javascripts « assets « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cdedc865d1b158eb247705c1b4d97e57d7e32a57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/* eslint-disable func-names, space-before-function-paren, object-shorthand, comma-dangle, padded-blocks, max-len */
// Disable an element and add the 'disabled' Bootstrap class
(function() {
  $.fn.extend({
    disable: function() {
      return $(this).attr('disabled', 'disabled').addClass('disabled');
    }
  });

  // Enable an element and remove the 'disabled' Bootstrap class
  $.fn.extend({
    enable: function() {
      return $(this).removeAttr('disabled').removeClass('disabled');
    }
  });

}).call(this);