This repository has been archived by the owner on Nov 1, 2020. It is now read-only.
Fix date picker not visible in slideshow sharing dialog #349
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.
Fixes #313
The jQuery UI Datepicker Widget automatically sets the
z-index
of the date picker element to thez-index+1
of the element it is called on. However the server sets thez-index
of the date picker using!important
in its CSS files, so it overrides the value set directly on the element. As thez-index
of the slideshow is100000
, thez-index
of the date picker element set in the server is1111
, and the date picker element is a sibling of the slideshow element the date picker appears behind it and thus it is not visible.But, why is the
z-index
explicitly set in the server CSS files if the widget automatically sets it? Because the automatic calculation of the z-index is flawed. Thez-index
of the element is got from the first ancestor (or itself) that has an absolute, relative or fixed position. However, the relevantz-index
for the date picker element is the one from the ancestor element that is also a sibling of the date picker element, so depending on the DOM structure and CSS rules the automaticz-index
could work or not, and thus an explicitz-index
is needed instead.Due to all this the problem has to be solved by overriding both the
z-index
set by the server CSS files and thez-index
automatically set on thestyle
attribute of the element, which fortunately can be done by setting thez-index
with!important
and a more specific selector than the one used in the server CSS file.