debian-mirror-gitlab/app/assets/javascripts/extensions/jquery.js

17 lines
405 B
JavaScript
Raw Normal View History

2016-09-29 09:46:39 +05:30
// Disable an element and add the 'disabled' Bootstrap class
2016-09-13 17:45:13 +05:30
(function() {
$.fn.extend({
disable: function() {
return $(this).attr('disabled', 'disabled').addClass('disabled');
}
});
2016-09-29 09:46:39 +05:30
// Enable an element and remove the 'disabled' Bootstrap class
2016-09-13 17:45:13 +05:30
$.fn.extend({
enable: function() {
return $(this).removeAttr('disabled').removeClass('disabled');
}
});
}).call(this);