Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-49292

There is no programmatic way to access Editor instance

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Reopened
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.7.6, 2.8.4
    • Fix Version/s: None
    • Component/s: HTML Editor (Atto)
    • Labels:
    • Testing Instructions:
      Hide

      This has no immediate effect in core as core does not use it.

      To test you need to make sure that Atto editor has not been affected at all.
      The code change is in the initialisation of the editor.

      1. Log in as an admin.
      2. Edit a course and check that the editor loads for the desc.
      3. Edit a quiz check that all editor instances load correctly.
      Show
      This has no immediate effect in core as core does not use it. To test you need to make sure that Atto editor has not been affected at all. The code change is in the initialisation of the editor. Log in as an admin. Edit a course and check that the editor loads for the desc. Edit a quiz check that all editor instances load correctly.
    • Affected Branches:
      MOODLE_27_STABLE, MOODLE_28_STABLE
    • Pull Master Branch:

      Description

      Sometimes it is useful to access Editor instance using javascript.
      For instance, when content of Editor needs to be cleaned or filled using pre-defined template.

      I suggest adding Editor instance to relevant textarea as one of data attribute:
      this.textarea.setData('Editor', this);

      In this case Editor instance can be accessed by:
      Y.one('#textareaid').getData('Editor')
      and perform required action like cleanEditorHTML or updateFromTextArea

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              valeriik Valerii Kuznetsov
              Reporter:
              valeriik Valerii Kuznetsov
              Peer reviewer:
              Frédéric Massart
              Integrator:
              Dan Poltawski
              Participants:
              Component watchers:
              Andrew Nicols, Jun Pataleta, Michael Hawkins, Shamim Rezaie, Simey Lameze
              Votes:
              0 Vote for this issue
              Watchers:
              8 Start watching this issue

                Dates

                Created:
                Updated: