[FIX] summernote: Summernote change the native id of the editable area if a script use a unique id, summernote break the default comportment. Replace id by data-note-id to set the editor 'id'
This commit is contained in:
@@ -48,7 +48,7 @@ define([
|
||||
if ($target.is('.note-editor, .note-air-editor')) {
|
||||
$editor = $target;
|
||||
} else {
|
||||
$editor = $('#note-editor-' + list.last($target.attr('id').split('-')));
|
||||
$editor = $('[data-note-id="' + list.last($target.attr('id')) + '"]');
|
||||
}
|
||||
|
||||
return dom.buildLayoutInfo($editor);
|
||||
|
||||
@@ -711,7 +711,7 @@ define([
|
||||
|
||||
$holder.addClass('note-air-editor note-editable');
|
||||
$holder.attr({
|
||||
'id': 'note-editor-' + id,
|
||||
'data-note-id': id,
|
||||
'contentEditable': true
|
||||
});
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ define([
|
||||
|
||||
// air mode
|
||||
if ($editor.hasClass('note-air-editor')) {
|
||||
var id = list.last($editor.attr('id').split('-'));
|
||||
var id = list.last($editor.attr('data-note-id'));
|
||||
makeFinder = function (sIdPrefix) {
|
||||
return function () { return $(sIdPrefix + id); };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user