Mercurial > kallithea
view MANIFEST.in @ 7961:34c8cb3198d8
diff: fix 2-way diff panel height
Since a jQuery upgrade in commit c225c37c069d, 2-way diff was broken: the
height was not correct, and sometimes the source code was shown in gray
boxes.
Analysis showed that in the invocation of mergely
(templates/files/diff_2way.html), '$("#footer").height()' is undefined, in
turn caused by the absence of an HTML element with id 'footer'.
In jQuery 3.0, the height function returns 'undefined' on empty sets, while
it was 'null' in older versions. This is important because in a mathematical
expression, 'null' behaves as the number 0, but 'undefined' causes a NaN
(not-a-number) result.
See: https://jquery.com/upgrade-guide/3.0/#breaking-change-return-values-on-empty-sets-are-undefined
The 'id' property on the footer was removed in commit 61c99cdbbfff,
retaining only the 'class="footer"'.
Fix the problem by using the class-based selector to get the footer height.
As the footer height will now be an actual value instead of '0' originally,
we can update the calculation without 'magic' values like '36' which was
actually a reference to the footer size.
When we initialize mergely, the page only contains the header and footer.
All window space below the footer can be assigned to the compare panes. The
height specified to mergely is thus the total window height minus the header
height (the top position of the footer) and the footer height.
Note: another change in this context is that jQuery 3.0 can now return
non-integer values for .height(), e.g. 138.0345. In the case of 2-way diff,
this is not an actual problem.
See: https://jquery.com/upgrade-guide/3.0/#breaking-change-width-height-css-quot-width-quot-and-css-quot-height-quot-can-return-non-integer-values
author | Thomas De Schampheleire <thomas.de_schampheleire@nokia.com> |
---|---|
date | Wed, 20 Nov 2019 15:12:23 +0100 |
parents | 19a9f02443c8 |
children | ddfecf9fe7f2 |
line wrap: on
line source
include .coveragerc include Apache-License-2.0.txt include CONTRIBUTORS include COPYING include Jenkinsfile include LICENSE-MERGELY.html include LICENSE.md include MIT-Permissive-License.txt include README.rst include dev_requirements.txt include development.ini include pytest.ini include requirements.txt include tox.ini recursive-include docs * recursive-include init.d * recursive-include kallithea/alembic * include kallithea/bin/ldap_sync.conf include kallithea/lib/paster_commands/template.ini.mako recursive-include kallithea/front-end * recursive-include kallithea/i18n * recursive-include kallithea/public * recursive-include kallithea/templates * recursive-include kallithea/tests/fixtures * recursive-include kallithea/tests/scripts * include kallithea/tests/models/test_dump_html_mails.ref.html include kallithea/tests/performance/test_vcs.py include kallithea/tests/vcs/aconfig recursive-include scripts *