traffic_graphs.widget: start when widgets is visible#4801
Merged
AdSchellevis merged 3 commits intoopnsense:masterfrom Mar 11, 2021
Merged
traffic_graphs.widget: start when widgets is visible#4801AdSchellevis merged 3 commits intoopnsense:masterfrom
AdSchellevis merged 3 commits intoopnsense:masterfrom
Conversation
Member
|
you're right, we can drop the |
Member
Author
|
@AdSchellevis thanks!! updated |
Member
|
@kulikov-a looks good, thanks! I haven't tried it myself yet, but it looks safe enough to pull in now |
Member
Author
|
@AdSchellevis thanks again! |
AdSchellevis
pushed a commit
that referenced
this pull request
Mar 14, 2021
AdSchellevis
pushed a commit
that referenced
this pull request
Mar 14, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Hi!
after a long investigation in the "messages" on the forum, it turned out that the traffic_graph widget is still not quite stable in the Firefox browser. The FF can start requests before the widgets are visible. As a result, the chart plugin assigns the canvas height to 0 (chartjs does not like if the parent element is hidden when the chart is initialized) and it start to look like #4750.
To reproduce the behavior, you can set a breakpoint on the
$("#traffic_graphs-configure").removeClass("disabled");in FF and refresh the page. It should be seen that the widgets div are not yet visible before executing the request.Could you consider adding an event after placing widgets and launching a widget functions on this trigger?
This change tested and gave: "TF loads every time on both my desktop (with all extensions enabled) and mobile FF!"
Thanks!
and that trigger can be used on other client-side widgets to start fetching when whole page is set
ps.
and its looks like this lines not needed any more. since we cut scripts from widgets. works with or without it
core/src/www/widgets/widgets/traffic_graphs.widget.php
Lines 67 to 72 in 7ac736d