mirror of
https://github.com/colymba/GridFieldBulkEditingTools.git
synced 2024-10-22 11:05:57 +02:00
FIX: Reading response header instead of hacking to get json type
This commit is contained in:
parent
3e49c1ff9f
commit
5c1764ad23
@ -135,15 +135,10 @@
|
|||||||
type: "POST",
|
type: "POST",
|
||||||
context: $(this)
|
context: $(this)
|
||||||
}).done(function(r) {
|
}).done(function(r) {
|
||||||
// A bit hacky, but it checks if the response is json
|
if(xhr.getResponseHeader('content-type').indexOf('json') >= 0 && r.message) {
|
||||||
try {
|
var msgType = r.messageType ? r.messageType : 'good';
|
||||||
$.parseJSON(r);
|
statusMessage(decodeURIComponent(r.message), msgType);
|
||||||
|
}
|
||||||
if(r.message) {
|
|
||||||
var msgType = r.messageType ? r.messageType : 'good';
|
|
||||||
statusMessage(decodeURIComponent(r.message), msgType);
|
|
||||||
}
|
|
||||||
} catch(e) { }
|
|
||||||
|
|
||||||
$(this).parents('.ss-gridfield').entwine('.').entwine('ss').reload();
|
$(this).parents('.ss-gridfield').entwine('.').entwine('ss').reload();
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user