mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-06 13:30:12 +03:00
None menu item & Fix clear response
This commit is contained in:
parent
9bf616677d
commit
c09ebe4622
|
@ -178,12 +178,14 @@
|
||||||
client.action(doc, key, params).then(function (data) {
|
client.action(doc, key, params).then(function (data) {
|
||||||
var response = JSON.stringify(data, null, 2);
|
var response = JSON.stringify(data, null, 2);
|
||||||
form.find(".request-awaiting").addClass("hide")
|
form.find(".request-awaiting").addClass("hide")
|
||||||
|
form.find(".response-data").text('')
|
||||||
form.find(".response-data").jsonView(response)
|
form.find(".response-data").jsonView(response)
|
||||||
form.find(".response-data").removeClass("hide")
|
form.find(".response-data").removeClass("hide")
|
||||||
}).catch(function (error) {
|
}).catch(function (error) {
|
||||||
var response = JSON.stringify(error.content, null, 2);
|
var response = JSON.stringify(error.content, null, 2);
|
||||||
form.find(".request-awaiting").addClass("hide")
|
form.find(".request-awaiting").addClass("hide")
|
||||||
form.find(".response-data").text(response)
|
form.find(".response-data").text('')
|
||||||
|
form.find(".response-data").jsonView(response)
|
||||||
form.find(".response-data").removeClass("hide")
|
form.find(".response-data").removeClass("hide")
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
@ -215,9 +217,15 @@
|
||||||
$('#selected-authentication').text('none');
|
$('#selected-authentication').text('none');
|
||||||
$('#auth-control').find("[data-auth='none']").addClass('active');
|
$('#auth-control').find("[data-auth='none']").addClass('active');
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
$('#auth-control').find("[data-auth='none']").click(function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
window.token = null;
|
||||||
|
$('#selected-authentication').text('none');
|
||||||
|
$('#auth-control').find("[data-auth='none']").addClass('active');
|
||||||
|
$('#auth-control').find("[data-auth='token']").removeClass('active');
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user