Skip to content
Snippets Groups Projects
Commit 001ab076 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

Fix #503

parent 5b696989
No related branches found
No related tags found
No related merge requests found
......@@ -10,7 +10,6 @@
//= require gdpr/cookie_consent
//= require sortablejs/Sortable
//= require summernote/summernote-bs5
//= require summernote-rails
//= require slug/slug
//= require cocoon
//= require_self
......
......@@ -3,6 +3,7 @@ $(function () {
'use strict';
var configs = [];
configs['mini'] = {
toolbar: [
['font', ['bold', 'italic']],
......@@ -26,7 +27,8 @@ $(function () {
disableDragAndDrop: true
};
configs['default'] = {
configs['full'] = {
popover: {
image: [
['remove', ['removeMedia']]
......@@ -37,6 +39,8 @@ $(function () {
['font', ['bold', 'italic']],
['position', ['superscript', 'subscript']],
['para', ['ul', 'ol']],
['table', ['table']],
['insert', ['link', 'picture', 'video']],
['view', ['codeview']]
],
styleTags: [
......@@ -66,16 +70,49 @@ $(function () {
}
};
configs['default'] = {
popover: {
image: [
['remove', ['removeMedia']]
]
},
toolbar: [
['style', ['style']],
['font', ['bold', 'italic']],
['position', ['superscript', 'subscript']],
['para', ['ul', 'ol']],
['view', ['codeview']]
],
styleTags: [
'p',
'blockquote',
'pre',
'h2',
'h3',
'h4'
],
followingToolbar: true,
disableDragAndDrop: true
};
$.extend($.summernote.lang['en-US'].image, {
dragImageHere: 'Drag file here',
dropImage: 'Drop file'
});
$('[data-provider="summernote"]').each(function () {
var config = $(this).attr('data-summernote-config');
var config = $(this).attr('data-summernote-config'),
options = {};
config = config || 'default';
$(this).summernote(configs[config]);
options = configs[config];
$(this).summernote(options);
});
// https://github.com/summernote/summernote/issues/4170
$("button[data-toggle='dropdown']").each(function (index) {
$(this).removeAttr("data-toggle").attr("data-bs-toggle", "dropdown");
});
window.SUMMERNOTE_CONFIGS = configs;
});
......@@ -4,7 +4,7 @@
color: black
font-weight: bold
.note-btn.dropdown-toggle:after
content: none
margin-left: 10px
.note-editable
img, video
height: auto
......@@ -12,6 +12,7 @@
button
background: transparent
border: none
margin-right: 10px
&.active
color: #666666 !important
blockquote
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment