[BUGFIX] Make JavaScript of SlugElement a real independent instance 73/58273/4
authorAndreas Fernandez <a.fernandez@scripting-base.de>
Fri, 14 Sep 2018 08:17:23 +0000 (10:17 +0200)
committerFrank Naegler <frank.naegler@typo3.org>
Fri, 14 Sep 2018 09:47:46 +0000 (11:47 +0200)
commit7da2da019eeed509a6d73c378a499f824fe30e6b
treef58e8b1acb3bd8bf882a56878b9a73b5e410f92f
parent704dba467eb9e96646d1814fa7aac0c011e3c6bb
[BUGFIX] Make JavaScript of SlugElement a real independent instance

The JavaScript for the SlugElement is partially designed to be a
independent instance for each slug field. However, this does not work for
mass editing the slug fields, as the `initialize()` method is always
called on the same instance.

This patch does multiple things:

- The JavaScript is converted to a TypeScript basis, which allows better
  handling of each instance
- The "Regenerate slug" button is disabled in case the "feeder" fields
  are not available to avoid getting bogus values

Resolves: #86221
Releases: master
Change-Id: I458247beb597c77407e94ce633314ae2e2d7095a
Reviewed-on: https://review.typo3.org/58273
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Christian Kuhn <lolli@schwarzbu.ch>
Tested-by: Christian Kuhn <lolli@schwarzbu.ch>
Reviewed-by: Frank Naegler <frank.naegler@typo3.org>
Tested-by: Frank Naegler <frank.naegler@typo3.org>
typo3/sysext/backend/Classes/Form/Element/InputSlugElement.php
typo3/sysext/backend/Resources/Private/TypeScript/FormEngine/Element/SlugElement.ts [new file with mode: 0644]
typo3/sysext/backend/Resources/Public/JavaScript/FormEngine/Element/SlugElement.js