|
@@ -131,7 +131,7 @@
|
|
|
|
|
|
// give a unique id to this editor instance
|
|
// give a unique id to this editor instance
|
|
var editorID = Math.ceil(Math.random() * 99999),
|
|
var editorID = Math.ceil(Math.random() * 99999),
|
|
- fieldName = this.name;
|
|
|
|
|
|
+ fieldName = $(this).attr('data-field-name') ? $(this).attr('data-field-name') : 'free_text';
|
|
|
|
|
|
var el = this;
|
|
var el = this;
|
|
var existingContent = $(el).html();
|
|
var existingContent = $(el).html();
|
|
@@ -151,10 +151,10 @@
|
|
|
|
|
|
quill.on('text-change', function(delta, oldDelta, source) {
|
|
quill.on('text-change', function(delta, oldDelta, source) {
|
|
var content = quill.root.innerHTML;
|
|
var content = quill.root.innerHTML;
|
|
- var dataValue = JSON.stringify({
|
|
|
|
- value: content
|
|
|
|
- });
|
|
|
|
- var dataField = $(el).closest('.note-section').find('input[name=data]').val(dataValue);
|
|
|
|
|
|
+ let dataObject = {};
|
|
|
|
+ dataObject[fieldName] = content;
|
|
|
|
+ var dataValue = JSON.stringify(dataObject);
|
|
|
|
+ $(el).closest('.note-section').find('input[name=data]').val(dataValue);
|
|
});
|
|
});
|
|
|
|
|
|
$(quill.container)
|
|
$(quill.container)
|