fix timeline float behavior

When we clear both, the float of the project menu is also factored in.

https://community.openproject.org/work_packages/16981

is the copy of https://github.com/opf/openproject/pull/2088