Skip to content

Commit 30e593e

Browse files
author
Emmanouil Konstantinidis
committed
Reset Form
1 parent 4d1c088 commit 30e593e

File tree

1 file changed

+9
-2
lines changed
  • rest_framework_docs/static/rest_framework_docs/js

1 file changed

+9
-2
lines changed

rest_framework_docs/static/rest_framework_docs/js/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,14 @@ var jsonPP = {
2222

2323
$( document ).ready(function() {
2424

25-
var cleanResponse = function () {
25+
var resetForm = function () {
26+
$('#methods').empty();
27+
$('#fields').empty();
28+
};
2629

30+
var cleanResponse = function () {
2731
$('#responseStatusCode').removeClass(function (index, css) {
28-
return (css.match (/(^|\s)label-\S+/g) || []).join(' ');
32+
return (css.match (/(^|\s)label-\S+/g) || []).join(' ');
2933
});
3034
$('#responseStatusText').text( '' );
3135
$('#responseData').html( '' );
@@ -130,6 +134,9 @@ $( document ).ready(function() {
130134
};
131135

132136
var setupForm = function (data) {
137+
// Reset Form - Remove Methods & Fields
138+
resetForm();
139+
133140
$('#urlInput').val(data.path);
134141

135142
_setupMethods(data.methods);

0 commit comments

Comments
 (0)