diff --git a/rest_framework/static/rest_framework/js/default.js b/rest_framework/static/rest_framework/js/default.js index ecaccc0f0..fc386d6b8 100644 --- a/rest_framework/static/rest_framework/js/default.js +++ b/rest_framework/static/rest_framework/js/default.js @@ -3,3 +3,11 @@ prettyPrint(); $('.js-tooltip').tooltip({ delay: 1000 }); + +$('#patch-form').find('.field-switcher').on('change', function() { + var $this = $(this); + $('#patch-form').find('#'+$this.attr('data-field-id')) + .prop('disabled', !$this.prop('checked')); +}); + +$('#form-method-switcher a:first').tab('show'); diff --git a/rest_framework/templates/rest_framework/base.html b/rest_framework/templates/rest_framework/base.html index 8ab9c5857..0c0b3351b 100644 --- a/rest_framework/templates/rest_framework/base.html +++ b/rest_framework/templates/rest_framework/base.html @@ -147,56 +147,63 @@ {% endif %} - {% if put_form %} + {% if put_form or patch_form %}