angular-ui / ui-tinymce

AngularUI wrapper for TinyMCE
MIT License
488 stars 370 forks source link

Inline and readonly not working #174

Closed deeg closed 9 years ago

deeg commented 9 years ago

There is an issue when trying to use readonly mode with inline mode. Normally if using readonly mode, contenteditable would not be set on the tinymce element.

The following code does not take that into account setting contenteditable=true even if readonly is set.

 function toggleDisable(disabled) {
          if (disabled) {
            ensureInstance();

            if (tinyInstance) {
              tinyInstance.getBody().setAttribute('contenteditable', false);
            }
          } else {
            ensureInstance();

            if (tinyInstance) {
              tinyInstance.getBody().setAttribute('contenteditable', true);
            }
          }
        }
deeg commented 9 years ago

This is in the latest v0.0.10 release.