Skip to content

bug: js error use own object extends HTMLElement #493

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions EventListener/AutoAddMissingTranslations.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@

namespace Translation\Bundle\EventListener;

use Symfony\Component\HttpKernel\Event\PostResponseEvent;
use Symfony\Component\HttpKernel\Event\TerminateEvent;
use Symfony\Component\Translation\DataCollectorTranslator;
use Translation\Bundle\Service\StorageService;
Expand All @@ -32,9 +31,6 @@ final class AutoAddMissingTranslations
*/
private $storage;

/**
* @param DataCollectorTranslator $translator
*/
public function __construct(StorageService $storage, DataCollectorTranslator $translator = null)
{
$this->dataCollector = $translator;
Expand All @@ -56,10 +52,3 @@ public function onTerminate(TerminateEvent $event): void
}
}
}

// PostResponseEvent have been renamed into ResponseEvent in sf 4.3
// @see https://github.com/symfony/symfony/blob/master/UPGRADE-4.3.md#httpkernel
// To be removed once sf ^4.3 become the minimum supported version.
if (!class_exists(TerminateEvent::class) && class_exists(PostResponseEvent::class)) {
class_alias(PostResponseEvent::class, TerminateEvent::class);
}
8 changes: 0 additions & 8 deletions EventListener/EditInPlaceResponseListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
namespace Translation\Bundle\EventListener;

use Symfony\Component\Asset\Packages;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Event\ResponseEvent;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Translation\Bundle\EditInPlace\ActivatorInterface;
Expand Down Expand Up @@ -128,10 +127,3 @@ public function onKernelResponse(ResponseEvent $event): void
$event->getResponse()->setContent($content);
}
}

// FilterResponseEvent have been renamed into ResponseEvent in sf 4.3
// @see https://github.com/symfony/symfony/blob/master/UPGRADE-4.3.md#httpkernel
// To be removed once sf ^4.3 become the minimum supported version.
if (!class_exists(ResponseEvent::class) && class_exists(FilterResponseEvent::class)) {
class_alias(FilterResponseEvent::class, ResponseEvent::class);
}
5 changes: 4 additions & 1 deletion Resources/public/js/editInPlace.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
*/
(function () {
if (typeof customElements.define !== "undefined") {
customElements.define("x-trans", HTMLElement);
// it is not possible to use HTMLElement directly
class XTrans extends HTMLElement {}

customElements.define("x-trans", XTrans);

return;
}
Expand Down