[BUGFIX] rtehtmlarea: Fix isRequiredClass check 93/50893/2
authorBenjamin Franzke <bfr@qbus.de>
Thu, 17 Nov 2016 08:34:14 +0000 (09:34 +0100)
committerSusanne Moog <susanne.moog@typo3.org>
Wed, 7 Dec 2016 13:18:13 +0000 (14:18 +0100)
commit8d9b76b9bdb9043cd5bd2b27b2a589a0523b2ccc
tree0a3e30a66e690a8cd9fb4d6867152a1ae9bd2639
parent2852669bdf4f32084645c4e06565dec13db034ab
[BUGFIX] rtehtmlarea: Fix isRequiredClass check

Given the following TSConfig:

  RTE {
    classes {
      btn-default {
        name = Default Button
        requires = btn
      }
      btn-primary {
        name = Primary Button
        requires = btn
      }
      btn.selectable = 0
    }
  }

The incorrect isRequiredClass check causes the btn class to be
removed from the RTE toolbarbuttons. This happens because it's
considered unneeded in DOM.removeClass(), which is called by
DOM.addClass() (to remove incompatible classes).

The check in isRequiredClass was probably copied from
some classesRequired lookups, but forgot to inverse the
class that's searched for.

This also fixes the RTE to properly remove the selectable=0 class
(e.g. btn), when a class that requires the aformentioned is removed
(e.g. btn-primary).

Releases: master, 7.6
Resolves: #78730
Change-Id: I5a6ac42c7080835d5018608ab17a39b36a0fb70a
Reviewed-on: https://review.typo3.org/50893
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: Wouter Wolters <typo3@wouterwolters.nl>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Susanne Moog <susanne.moog@typo3.org>
Tested-by: Susanne Moog <susanne.moog@typo3.org>
typo3/sysext/rtehtmlarea/Resources/Public/JavaScript/HTMLArea/DOM/DOM.js