Commit f56729db by cahrens

Turn off line wrapping.

parent dd50313f
...@@ -56,16 +56,21 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({ ...@@ -56,16 +56,21 @@ CMS.Views.Settings.Advanced = CMS.Views.ValidatingView.extend({
attachJSONEditor : function (textarea) { attachJSONEditor : function (textarea) {
var self = this; var self = this;
CodeMirror.fromTextArea(textarea, { CodeMirror.fromTextArea(textarea, {
mode: "application/json", lineNumbers: false, lineWrapping: true, mode: "application/json", lineNumbers: false, lineWrapping: false,
onChange: function() { onChange: function() {
self.showSaveCancelButtons(); self.showSaveCancelButtons();
}, },
onBlur: function (mirror) { onBlur: function (mirror) {
var key = $(mirror.getWrapperElement()).closest('.row').children('.key').attr('id'); var key = $(mirror.getWrapperElement()).closest('.row').children('.key').attr('id');
var quotedValue = mirror.getValue(); var quotedValue = mirror.getValue();
// TODO: error checking try {
var JSONValue = JSON.parse(quotedValue); var JSONValue = JSON.parse(quotedValue);
self.model.set(key, JSONValue, {validate: true}); self.model.set(key, JSONValue, {validate: true});
}
catch (e) {
// TODO: error checking
console.log(e);
}
} }
}); });
}, },
......
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