[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:
Christophe Matthieu
2015-03-09 16:33:03 +01:00
parent 6cce8d5a55
commit 513d1a26d1
3 changed files with 3 additions and 3 deletions
@@ -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); };
};