debian-mirror-gitlab/app/assets/javascripts/extensions/jquery.js
2016-09-29 09:46:39 +05:30

16 lines
405 B
JavaScript

// 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);