Uploaded image for project: 'translate5'
  1. translate5
  2. TRANSLATE-3035

UI spellcheck is not working after a task with disabled spellcheck was opened

    XMLWordPrintable

Details

    • High
    • Spellcheck remained disabled for other tasks after opening one task where spellcheck was explicitly disabled with liveCheckOnEditing config.

    Description

      problem

      1. Open a task liveCheckOnEditing = 0
      2. Change to a task where liveCheckOnEditing = 1
      3. The spellcheck will still not work

      reason

      The reason for this behaviour is a logical bug in the spellcheck controller: 

      /***
       * After task config load event handler.
       */
      onEditorConfigLoaded:function(app, task){
          var me=this,
              isPluginActive = app.getTaskConfig('plugins.SpellCheck.liveCheckOnEditing');
          me.setActive(isPluginActive);
      },

       

      1. The above event handler is evaluating the tasks config.
      2. If liveCheckOnEditing in a task is disabled, this disables the whole controller
      3. After changing to another task - where liveCheckOnEditing is enabled - the event handler onEditorConfigLoaded is never called again since the whole controller is deactivated

      Conclusion

      deactivating of a controller is a useful way to disable a controller / feature but can not be controlled from inside the controller.

      Solution

      spellcheck disabling must be implemented via an internal deactivation flag instead of deactivating the whole controller

      Attachments

        Activity

          People

            aleksandar Aleksandar Mitrev
            tlauria Thomas Lauria
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: