Skip to content

Commit 47a6128

Browse files
author
Leny BERNARD
committed
Merge pull request #305 from gregumo/master
Update View's CSS of updated Views
2 parents 08af59e + 6979a6f commit 47a6128

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Bundle/CoreBundle/EventSubscriber/WidgetSubscriber.php

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public function onFlush(OnFlushEventArgs $args)
6565
$updatedEntities = $this->uow->getScheduledEntityUpdates();
6666
$deletedEntities = $this->uow->getScheduledEntityDeletions();
6767

68-
//Update CSS of this widget View and its inheritors if this View is a Template
68+
//Update View's CSS and inheritors of updated and deleted widgets
6969
foreach (array_merge($updatedEntities, $deletedEntities) as $entity) {
7070
if (!($entity instanceof Widget)) {
7171
continue;
@@ -76,7 +76,7 @@ public function onFlush(OnFlushEventArgs $args)
7676
$this->updateTemplateInheritorsCss($view);
7777
}
7878

79-
//Remove CSS of this widget View and update its inheritors if this View is a Template
79+
//Remove CSS of deleted View and update its inheritors
8080
foreach ($deletedEntities as $entity) {
8181
if (!($entity instanceof View)) {
8282
continue;
@@ -85,6 +85,16 @@ public function onFlush(OnFlushEventArgs $args)
8585
$this->viewCssBuilder->removeCssFile($entity->getCssHash());
8686
$this->updateTemplateInheritorsCss($entity);
8787
}
88+
89+
//Update CSS of updated View and its inheritors
90+
foreach ($updatedEntities as $entity) {
91+
if (!($entity instanceof View)) {
92+
continue;
93+
}
94+
95+
$this->updateViewCss($entity);
96+
$this->updateTemplateInheritorsCss($entity);
97+
}
8898
}
8999

90100
/**

0 commit comments

Comments
 (0)