Skip to content

Commit

Permalink
fix inappropriate style injection
Browse files Browse the repository at this point in the history
  • Loading branch information
acalvino4 committed Jul 20, 2024
1 parent b5ec608 commit df54afe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Easy Image

## [2.0.1] - 2024-07-20

- Fixed regression that unscroupulously injected opinionated styles into templates

## [2.0.0] - 2024-07-13

- Updated dependencies for Craft 5
Expand All @@ -21,6 +25,7 @@
- Added placeholder support
- Added tests

[2.0.1]: (https://github.com/acalvino4/craft-easy-image/releases/tag/2.0.1)
[2.0.0]: (https://github.com/acalvino4/craft-easy-image/releases/tag/2.0.0)
[1.0.1]: (https://github.com/acalvino4/craft-easy-image/releases/tag/1.0.1)
[1.0.0]: (https://github.com/acalvino4/craft-easy-image/releases/tag/1.0.0)
5 changes: 0 additions & 5 deletions src/Plugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
use craft\base\Model;
use craft\base\Plugin as BasePlugin;
use craft\events\RegisterTemplateRootsEvent;
use craft\events\TemplateEvent;
use craft\web\View;
use yii\base\Event;

Expand Down Expand Up @@ -69,9 +68,5 @@ private function attachEventHandlers(): void
Event::on(View::class, View::EVENT_REGISTER_SITE_TEMPLATE_ROOTS, function(RegisterTemplateRootsEvent $e) {
$e->roots['easy-image'] = __DIR__ . '/templates';
});

Event::on(View::class, View::EVENT_BEFORE_RENDER_TEMPLATE, function(TemplateEvent $event) {
Craft::$app->getView()->registerCss("img, video {object-fit: cover;}");
});
}
}

0 comments on commit df54afe

Please sign in to comment.