From c9374532a9b519c85182e079b96b479bd09b0a4a Mon Sep 17 00:00:00 2001 From: Andy Piper Date: Tue, 11 Feb 2014 13:21:30 +0000 Subject: [PATCH] Fix for bad MIME Content-Type (per #152) --- public/red/main.js | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/public/red/main.js b/public/red/main.js index 074ed6bb9..436124228 100644 --- a/public/red/main.js +++ b/public/red/main.js @@ -16,14 +16,14 @@ var RED = function() { $('#btn-keyboard-shortcuts').click(function(){showHelp();}); - - + + $('#chart').on("dragenter",function(event) { if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1) { $("#dropTarget").css({display:'table'}); } }); - + $('#dropTarget').on("dragover",function(event) { if ($.inArray("text/plain",event.originalEvent.dataTransfer.types) != -1) { event.preventDefault(); @@ -37,8 +37,8 @@ var RED = function() { RED.view.importNodes(data); $("#dropTarget").hide(); }); - - + + function save(force) { if (RED.view.dirty()) { @@ -70,7 +70,8 @@ var RED = function() { } var nns = RED.nodes.createCompleteNodeSet(); - d3.xhr("flows").post(JSON.stringify(nns),function(err,resp) { + d3.xhr("flows").header("Content-type", "application/json") + .post(JSON.stringify(nns),function(err,resp) { if (resp && resp.status == 204) { RED.notify("Successfully deployed","success"); RED.view.dirty(false);