2

I want to use Medium Editor for inline editing. On one page it's working. However on another page I want the editor to be disabled at the beginning, as the text is normally only for reading. It's disabled with disableEditing: true when initializing the editor.

However I can't enable it again. I found nothing about changing the settings afterwards and whatever I tried, nothing worked.

var helpeditor = new MediumEditor("#htext", {
  extensions: {
    "autolist": autolist
  },
  toolbar: {
    buttons: ["bold", "italic", "underline", "unorderedlist", "orderedlist", "justifyLeft", "justifyCenter"]
  },
  disableEditing: true
});
Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339
  • From the [documentation](https://github.com/yabwe/medium-editor/blob/master/API.md#setup) it doesn't look like that library supports changing properties after initialisation. You'd need to destroy the existing instance and create a new one which does allow editing. Alternatively, use a better library which meets all your needs. – Rory McCrossan Mar 05 '20 at 09:41
  • Yes, destroying and new setting up works now. I just wonder what sense it makes to create such a behavior?? Thanks for you tip! –  Mar 05 '20 at 10:19
  • Glad you got it working. I added it as an answer for you. – Rory McCrossan Mar 05 '20 at 10:21

1 Answers1

0

From the documentation it doesn't look like that library supports changing properties after initialisation. You'd need to destroy() the existing instance and create a new one which does allow editing.

Alternatively, use a better library which meets all your needs.

Rory McCrossan
  • 331,213
  • 40
  • 305
  • 339