Kademi / keditor

KEditor is a jQuery plugin which provides a content editor with drag n drop, configurable contents
http://kademi.github.io/keditor/
MIT License
319 stars 153 forks source link

[BUG] Calling setcontent loses the ability to add a new section #233

Closed StevieDC closed 4 years ago

StevieDC commented 4 years ago

Hi, I am trying to save the users content and then reload it at a later date for them to continue editing. However, when I call 'setcontent' it loads the saved data (keeping the sections separate etc.) but I lose the + icon at the bottom that allows the user to add a new section. Please advise. Thanks.

Here is an example of my code:

            var cnt =
                '<div class="row">' +
                '   <div class="col-sm-12 ui-resizable" data-type="container-content">' +
                '       <div data-type="component-vimeo">' +
                '          <div class="vimeo-wrapper">' +
                '             <div class="embed-responsive embed-responsive-16by9">' +
                '                <iframe class="embed-responsive-item" src="https://player.vimeo.com/video/20570767?byline=0&amp;portrait=0&amp;badge=0"></iframe>' +
                '             </div>' +
                '          </div>' +
                '       </div>' +
                '   </div>' +
                '</div>';

            $('#content-area').keditor({
                tabTooltipEnabled: false, // disable bootstrap tooltip of tab on touch device
                snippetsTooltipEnabled: false  // disable bootstrap tooltip of snippets on touch device
            });

            $('#content-area').keditor('setContent', cnt);
ducdhm commented 4 years ago

@StevieDC It's working normally. Maybe you're using old version. Please try again with latest version. If this issue still occur, please reopen this ticket.