On Thu, 8 Oct 2020 09:36:04 GMT, Hannes Wallnöfer <hann...@openjdk.org> wrote:

>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js
>>  line 89:
>> 
>>> 87:             selected.previousSibling.focus();
>>> 88:             e.preventDefault();
>>> 89:         } else if ((e.keyCode === 39 || e.keyCode === 40) && 
>>> selected.nextSibling) {
>> 
>> Can we have constants, or at least a comment for the values 37, 38, 39, 40
>
> I'm adding comments in my next commit. We don't have immutable `const` 
> declarations in JS due to backwards
> compatibility, so I'm not keen to add a `var` pseudo-constant.

👍

>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/script.js
>>  line 58:
>> 
>>> 56:         .forEach(function(elem, index) {
>>> 57:             elem.style.display = '';
>>> 58:             var isEvenRow = index % (columns * 2) < columns;
>> 
>> OK, this line is weird.  Why is the polarity of the row dependent on the 
>> number of columns?
>
> Unfortunately we don't have one element per row. The number of elements per 
> row is equal to the number of columns,
> therefore this calculation is necessary to determine the row style.

Aha, understood 👍

-------------

PR: https://git.openjdk.java.net/jdk/pull/253

Reply via email to