[BUGFIX] rtehtmlarea: Fix isRequiredClass check 92/50692/3
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:06:35 +0000 (14:06 +0100)
commit30d9a1c645e3c2962b5960fa6b6727a168d0c0d5
treec95fd60d91bf05278db0332ef553daf883bbc5b6
parent8fe959735d55239222eba48c9eb3978551bd30b8
[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/50692
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