Commit 5658a03c by Xavier Antoviaque

Merge pull request #3 from FiloSottile/fix

Fix get_data in Apros
parents 6c3c75a3 b713e0c7
...@@ -105,7 +105,7 @@ function DragAndDropBlock(runtime, element) { ...@@ -105,7 +105,7 @@ function DragAndDropBlock(runtime, element) {
zone: zone, zone: zone,
top: $el.css('top'), top: $el.css('top'),
left: $el.css('left') left: $el.css('left')
})).done(function(data){ }), 'json').done(function(data){
if (data.correct) { if (data.correct) {
$el.draggable('disable'); $el.draggable('disable');
...@@ -235,7 +235,9 @@ function DragAndDropBlock(runtime, element) { ...@@ -235,7 +235,9 @@ function DragAndDropBlock(runtime, element) {
}; };
})(jQuery); })(jQuery);
$.ajax(runtime.handlerUrl(element, 'get_data')).done(function(data){ $.ajax(runtime.handlerUrl(element, 'get_data'), {
dataType: 'json'
}).done(function(data){
dragAndDrop.init(data); dragAndDrop.init(data);
}); });
} }
...@@ -385,7 +385,7 @@ function DragAndDropEditBlock(runtime, element) { ...@@ -385,7 +385,7 @@ function DragAndDropEditBlock(runtime, element) {
$('.xblock-editor-error-message', element).html(); $('.xblock-editor-error-message', element).html();
$('.xblock-editor-error-message', element).css('display', 'none'); $('.xblock-editor-error-message', element).css('display', 'none');
var handlerUrl = runtime.handlerUrl(element, 'studio_submit'); var handlerUrl = runtime.handlerUrl(element, 'studio_submit');
$.post(handlerUrl, JSON.stringify(data)).done(function(response) { $.post(handlerUrl, JSON.stringify(data), 'json').done(function(response) {
if (response.result === 'success') { if (response.result === 'success') {
window.location.reload(false); window.location.reload(false);
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment