diff --git a/media/js/config.js b/media/js/config.js index 2626a555d2a8241e4f721f583b01927b84005c4f..281d0427b075b9d34a56bddea19e2b5452182cdd 100644 --- a/media/js/config.js +++ b/media/js/config.js @@ -11,6 +11,16 @@ $.postJSON = function (url, data, callback) { return $.post(url, data, callback, 'json'); }; +$.fn.extend({ + turnOn: function () { + return $(this).prop('disabled', false) + }, + + turnOff: function () { + return $(this).prop('disabled', true) + }, +}); + var Auth = (function () { var allowRequest = true; diff --git a/media/js/discipline/editStructure.js b/media/js/discipline/editStructure.js index 4a41aa5e9f81fb35f99c0752c1d72f51d72853b0..a73436b0f50620d537016a11aab3247e9795c038 100644 --- a/media/js/discipline/editStructure.js +++ b/media/js/discipline/editStructure.js @@ -22,15 +22,7 @@ $(document).ready(function () { sum += parseInt(0 + ( asText ? $(this).text() : $(this).val() )) }); return sum; - }, - - turnOn: function () { - return $(this).prop('disabled', false) - }, - - turnOff: function () { - return $(this).prop('disabled', true) - }, + } });