Skip to content

Commit ed9a431

Browse files
committed
FutureEntry: Simplify implementation
If it's not an `.entry`, that's fine. But making the child one, is not. Only children of the overlay must be entries. If style rules apply, copy them over.
1 parent 123e6ab commit ed9a431

2 files changed

Lines changed: 12 additions & 13 deletions

File tree

library/Notifications/Widget/Timeline/FutureEntry.php

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,16 @@
1414
* FutureEntry
1515
*
1616
* Visualize a future entry of the rotation
17-
*
18-
* @extends Entry<0>
1917
*/
2018
class FutureEntry extends Entry
2119
{
20+
protected $defaultAttributes = ['class' => 'future-entry'];
21+
22+
protected $continuationType = Entry::TO_NEXT_GRID;
23+
2224
public function __construct()
2325
{
2426
parent::__construct(0);
25-
26-
$this->setContinuationType(Entry::TO_NEXT_GRID);
2727
}
2828

2929
public function getColor(int $transparency): string
@@ -34,17 +34,12 @@ public function getColor(int $transparency): string
3434

3535
protected function assembleContainer(BaseHtmlElement $container): void
3636
{
37-
$futureBadge = new HtmlElement(
37+
$container->addHtml(new HtmlElement(
3838
'div',
3939
new Attributes([
40-
'title' => $this->translate('Rotation starts in the future'),
41-
$container->getAttributes()->get('class')
40+
'title' => $this->translate('Rotation starts in the future')
4241
]),
4342
new Icon('angle-right')
44-
);
45-
46-
$container
47-
->setAttribute('class', 'future-entry') // override the default class
48-
->addHtml($futureBadge);
43+
));
4944
}
5045
}

public/css/timeline.less

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,8 +65,12 @@
6565
.future-entry {
6666
display: flex;
6767
justify-content: end;
68+
z-index: 2; // overlap the .clock .time-hand
69+
pointer-events: all;
6870

69-
.entry {
71+
> div {
72+
margin-top: 1em;
73+
margin-bottom: 1em;
7074
display: flex;
7175
align-items: center;
7276
justify-content: end;

0 commit comments

Comments
 (0)