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",
|
||||
context: $(this)
|
||||
}).done(function(r) {
|
||||
// A bit hacky, but it checks if the response is json
|
||||
try {
|
||||
$.parseJSON(r);
|
||||
|
||||
if(r.message) {
|
||||
var msgType = r.messageType ? r.messageType : 'good';
|
||||
statusMessage(decodeURIComponent(r.message), msgType);
|
||||
}
|
||||
} catch(e) { }
|
||||
if(xhr.getResponseHeader('content-type').indexOf('json') >= 0 && r.message) {
|
||||
var msgType = r.messageType ? r.messageType : 'good';
|
||||
statusMessage(decodeURIComponent(r.message), msgType);
|
||||
}
|
||||
|
||||
$(this).parents('.ss-gridfield').entwine('.').entwine('ss').reload();
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user