Fixed the NodeAjaxOtionsControl formatter, which was causing malformed
string, when have special character.pull/3/head
parent
79cd9d518c
commit
359dff0f78
|
@ -8,11 +8,11 @@ function($, _, pgAdmin, Backbone, Backform, Alertify, Node) {
|
||||||
var StringOrJSONFormatter = function() {};
|
var StringOrJSONFormatter = function() {};
|
||||||
_.extend(StringOrJSONFormatter.prototype, {
|
_.extend(StringOrJSONFormatter.prototype, {
|
||||||
fromRaw: function(rawData, model) {
|
fromRaw: function(rawData, model) {
|
||||||
return JSON.stringify(rawData);
|
return JSON.stringify(_.escape(rawData));
|
||||||
},
|
},
|
||||||
toRaw: function(formattedData, model) {
|
toRaw: function(formattedData, model) {
|
||||||
if (typeof(formattedData) == 'string') {
|
if (typeof(formattedData) == 'string') {
|
||||||
return formattedData;
|
return _.unescape(formattedData);
|
||||||
}
|
}
|
||||||
return JSON.parse(formattedData);
|
return JSON.parse(formattedData);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue