grapesjs icon indicating copy to clipboard operation
grapesjs copied to clipboard

QUESTION: Allow to only edit text

Open mmotov opened this issue 6 years ago • 1 comments

Hi there! I wonder if it's possible somehow to allow edit only text, or upload images, and restrict to change everything else? The purpose of that is to allow designer create website, and user will fill only content. Thank you in advance.

mmotov avatar Sep 23 '20 13:09 mmotov

Ok, I found solution for that #336 I did this

editor.DomComponents.getComponents().each(c => restrictUpdate(c));

restrictUpdate(component) {
          component.set({
            removable: false,
            draggable: false,
            droppable: false,
            stylable: false,
            copyable: false,
            resizable: false,
            editable: true,
            selectable: true,
            badgable: false,
            highlightable: false

          })
        component.get('components').each(c => this.restrictUpdate(c))
}

mmotov avatar Sep 24 '20 13:09 mmotov