-
Notifications
You must be signed in to change notification settings - Fork 0
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
Schedules: Add timescale and time indicator #292
base: main
Are you sure you want to change the base?
Conversation
62d68b8
to
505ac04
Compare
505ac04
to
8ea7052
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Additional note: Your PR introduces a vertical scrollbar. This is probably caused by your translate rules. Please recheck your code and fix it.
EDIT: A overflow: hidden
on line 67
in timeline.less
fixes it
use ipl\Web\Style; | ||
use Locale; | ||
|
||
class Timescale extends BaseHtmlElement |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The class documentation is missing (PHPDoc)
$allTimestamps = array_merge(...array_fill(0, $this->days, $dayTimestamps)); | ||
|
||
$lastPosition = count($allTimestamps) - 1; | ||
|
||
$fakeLast = clone $allTimestamps[$lastPosition]; | ||
$allTimestamps[$lastPosition] = $fakeLast->addAttributes(['class' => 'last']); | ||
// added the class to add them into the same cell | ||
$first = clone $allTimestamps[0]; | ||
$allTimestamps[] = $first->addAttributes(['class' => 'midnight']); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe a description would be helpful as to why the clones are needed (array_fill works with references and fills the array positions with references to the same $dayTimestamps
array, changing something on its contents, changes it in all positions).
new HtmlElement( | ||
'div', | ||
new Attributes(['class' => 'now', 'title' => $dateFormatter->format($now)]), | ||
Text::create('now') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is missing a translation
@sukhwinder33445 I've also noticed that something's off in Firefox. While the timeline and grid render correctly, the timescale's off. It's especially noticeable when using the monthly view. |
0384a27
to
a40eb0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a40eb0f
to
fead6e6
Compare
Firefox still has problems (@flourish86 and @nilmerg say it's not that important), but Safari and Chrome work perfectly now. |
public/css/timeline.less
Outdated
background-color: @gray-light; | ||
font-size: 0.75em; | ||
color: red; | ||
user-select: none; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found, that it won't work on Safari and a Quick Look here shows, that you probably need the prefixes for all browsers to make this work.
So I'd suggest to add
-webkit-user-select: none;
-moz-user-select: none;
and optionally
-ms-user-select: none;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahmm, fortunately we have a mixin for that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Safari disables the selection, but still shows the caret
cursor 🤦.
fead6e6
to
66923ce
Compare
66923ce
to
9f54900
Compare
9f54900
to
5d70ce3
Compare
resolves #283