Skip to content

Commit 02ed5b4

Browse files
committed
added contentType: application/json to the interface to fix the collapsing bug #3
1 parent e5ab4a3 commit 02ed5b4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

public/js/main.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,9 @@ $( "#formEditManifest" ).submit(function( event ) {
101101
$.ajax(
102102
{
103103
url : formURL,
104+
contentType: "application/json",
104105
method: "PUT",
105-
data : payload,
106+
data : postDataJSON,
106107
success:function(data, textStatus, jqXHR)
107108
{
108109
refreshManifests('alert-success','<h2>Manifest created:</h2><pre>' + postDataJSON + '</pre>');
@@ -116,7 +117,9 @@ $( "#formEditManifest" ).submit(function( event ) {
116117
});
117118

118119
$( "#formAddManifest" ).submit(function( event ) {
119-
console.log("formdata: " + $(this));
120+
event.preventDefault();
121+
event.stopPropagation();
122+
120123
var postData = $(this).serializeArray();
121124
var payload = JSON.parse(postData[0].value);
122125
var formURL = $(this).attr("action");
@@ -126,8 +129,9 @@ $( "#formAddManifest" ).submit(function( event ) {
126129
$.ajax(
127130
{
128131
url : formURL,
132+
contentType: "application/json",
129133
method: "POST",
130-
data : payload,
134+
data : postDataJSON,
131135
success:function(data, textStatus, jqXHR)
132136
{
133137
refreshManifests('alert-success','<h2>Manifest created:</h2><pre>' + postDataJSON + '</pre>');
@@ -138,9 +142,6 @@ $( "#formAddManifest" ).submit(function( event ) {
138142
}
139143
});
140144

141-
event.preventDefault();
142-
event.stopPropagation();
143-
144145
});
145146

146147
// This code handles the expandable textarea

0 commit comments

Comments
 (0)