Hi,
When a module's stats page is displayed (display.cgi) and you hover one of the charts (hour, day, week, etc.) there is a date displayed at the top-left of the chart. The date is in a DIV#datebox and it is absolutely positioned so to be over the hovered chart. But maybe after some DOM update the charts are now in a scrolling element #content > div[data-dcontainer="1"] and the datebox is out of that. So when you scroll down to see the monthly chart for example and hover that then the datebox gets positioned very far down in the non-scrolling BODY and is not visible. Even for the weekly chart I can't see it.
The fix seems simple to me:
In "sysstats/display.js"
line 185: document.body.appendChild(box);
becomes: document.querySelector('[data-dcontainer="1"]').appendChild(box);
And now the datebox will follow the charts as you scroll. The date's position is now a bit too low so one more change:
line 47: var datebox_y = coords.top + 5;
needs to be: var datebox_y = coords.top - 10;
And it will appear right at the top.
I thought to make a GIT pull request but could not find out how to do that with Sourceforge. The change is quite simple though.
Cheers
Anonymous
I think I got there with the MR https://sourceforge.net/p/webminstats/git/merge-requests/1/
Thank you very much for this patch. I'm testing it and it will be included in next release (2.23)
I have tested it, and I notice 2 problems
- first, your code is only working with the default theme "authentic theme". Is it possible to test and use your code on authentic, and else use my old code
- second, the display is now centered and is somewhat hidden by the graphic title. Is it possible to display the date on the left as before ?
I see what you mean about the theme. I didn't expect the theme to affect a module that much.
The last commit makes the new code to only run for the "authentic" theme and the old code will run for all other themes.
As for the second point - it looks alright on latest Chrome and Safari on OSX and I thought browsers are pretty aligned these days ;) What browser (and maybe what OS) do you see that in?
I am using firefox or chromium or brave on mainly fedora/debian/ubuntu
but do not worry, I can read the date. Your patch is now committed in the devel branch.
I will probably have the next release in february.
thanks for your work !
Cheers