DennisSuitters / summernote-image-attributes

Summernote plugin to edit image attributes
MIT License
89 stars 89 forks source link

This doesn't seem to be working for me. #42

Closed SilasOlatayo closed 6 years ago

SilasOlatayo commented 6 years ago

Hi, I did an upgrade to SN 0.8.9 and some plugins stop working; so I upgraded to this latest version as well but still not working. I have all set properly as required. I am currently using jQuery v1.11.1 (because of Bootstrap v3.3.6)

See my code below

var advEditor =  function(domElement){
    if(jQuery().summernote){
        $(domElement).summernote({
            height: 450,
            minHeight: 50,
            maxHeight: 850,
            dialogsInBody: false,
            dialogsFade: true,
            toolbar: [
                ['cleaner',['cleaner']],
                ['style', ['style', 'bold', 'italic', 'underline', 'clear']],
                ['font-e', ['strikethrough', 'superscript', 'subscript']],
                ['pagebreak',['pagebreak']],
                ['font', ['fontname', 'fontsize', 'color']],
                ['para', ['ul', 'ol', 'paragraph']],
                ['height',['height', 'hr']],
                ['table',['table']],
                ['media', ['media', 'link', 'pictureBtn', /*'video',*/ 'videoAttributes']],
                ['insert', ['emojiList', 'specialChar']],
                ['misc', ['undo', 'redo', 'codeview', 'fullscreen', 'help']]
            ],
            buttons: {
                pictureBtn: insertPicture
            },
            popover: {
                image: [
                    ['custom', ['imageAttributes', 'imageShape', 'captionIt']],
                    ['imagesize', ['imageSize100', 'imageSize50', 'imageSize25']],
                    ['float', ['floatLeft', 'floatRight', 'floatNone']],
                    ['remove', ['removeMedia']]
                ],
            },
            imageAttributes:{
                icon:'',
                removeEmpty:false
            },
            imageShape: {
                icon: ''
            },
            captionIt:{
                figureClass:'{figure-class/es}',
                figcaptionClass:'{figcapture-class/es}',
                captionText:'{Default Caption Editable Placeholder Text if Title or Alt are empty}'
            },
            cleaner:{
                notTime: 2400,
                action: 'both', // both|button|paste 'button' only cleans via toolbar button, 'paste' only clean when pasting content, both does both options.
                newline: '
', notStyle: 'position:absolute;top:0px;left:0;right:0', icon: '', keepHtml: false, keepClasses: false, badTags: ['style', 'script', 'applet', 'embed', 'noframes', 'noscript'/*, 'html'*/], badAttributes: ['start'] }, callbacks:{ onInit:function(){ $('body > .note-popover').appendTo(".note-editing-area"); } } }); } }
SilasOlatayo commented 6 years ago

I think

onInit:function(){ $('body > .note-popover').appendTo(".note-editing-area"); }

is the issue... I will append it somewhere else