Skip to content

Conversation

RyanSquared
Copy link
Contributor

No description provided.

@coveralls
Copy link

coveralls commented Nov 17, 2016

Coverage Status

Coverage remained the same at 86.227% when pulling aa774da on ChickenNuggers:master into 5e0c250 on daurnimator:master.

@coveralls
Copy link

coveralls commented Nov 17, 2016

Coverage Status

Coverage remained the same at 86.227% when pulling 5d60db4 on ChickenNuggers:master into 5e0c250 on daurnimator:master.

}
}
element.insertBefore(dropdown_link_copy,
element.querySelector('a').nextSibling);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this hard-wrapped?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

dropdown_link.innerHTML = ' <b>+</b>'; // the space is for padding
dropdown_link.style.cursor = 'pointer';
// hack in an ID name for the module list
var collapsibleList = document.querySelectorAll('nav ul li > ul > li')
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to assign this to a variable

dropdown_link.style.cursor = 'pointer';
// hack in an ID name for the module list
var collapsibleList = document.querySelectorAll('nav ul li > ul > li')
collapsibleList.forEach(function(element) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I recall the return value of document.querySelectorAll not actually being an array in some browsers, and hence methods don't work unless you get them from the Array prototype?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NodeList.forEach() != Array.forEach(). Mozilla documentation, along with other things I've found, say that NodeList guarantees a forEach.

// write out a basic 'dropdown_link' reference element
var dropdown_link = document.createElement('a');
dropdown_link.setAttribute('class', 'dropdown_link');
dropdown_link.onclick = function(e) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why give an empty onclick?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

(function() {
// write out a basic 'dropdown_link' reference element
var dropdown_link = document.createElement('a');
dropdown_link.setAttribute('class', 'dropdown_link');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I recall .setAttribute("class" having issues: assign to .className instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

}
dropdown_link.innerHTML = ' <b>+</b>'; // the space is for padding
dropdown_link.style.cursor = 'pointer';
// hack in an ID name for the module list
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment isn't relevant any more?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

var collapsibleList = document.querySelectorAll('nav ul li > ul > li')
collapsibleList.forEach(function(element) {
// add a clone of the node to prevent lingering element scoping
// otherwise each time a dropdown is clicked it only does the last one
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand this comment.

collapsibleList.forEach(function(element) {
// add a clone of the node to prevent lingering element scoping
// otherwise each time a dropdown is clicked it only does the last one
var dropdown_link_copy = dropdown_link.cloneNode(true);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this down below the early return?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved

return;
list.style.display = 'none';
element.setAttribute('state', 'up');
dropdown_link_copy.onclick = function() {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it would make more sense to have an open and a close function that you swap between?..... maybe not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same issue as insertAfter - use in only 1.5 places.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.227% when pulling 40f72be on ChickenNuggers:master into 5e0c250 on daurnimator:master.

4 similar comments
@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.227% when pulling 40f72be on ChickenNuggers:master into 5e0c250 on daurnimator:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.227% when pulling 40f72be on ChickenNuggers:master into 5e0c250 on daurnimator:master.

@coveralls
Copy link

Coverage Status

Coverage remained the same at 86.227% when pulling 40f72be on ChickenNuggers:master into 5e0c250 on daurnimator:master.

@coveralls
Copy link

coveralls commented Nov 17, 2016

Coverage Status

Coverage remained the same at 86.227% when pulling 40f72be on ChickenNuggers:master into 5e0c250 on daurnimator:master.

dropdown_link.innerHTML = ' <b>+</b>'; // the space is for padding
dropdown_link.style.cursor = 'pointer';
document.querySelectorAll('nav ul li > ul > li').forEach(
function(element) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be indented one level further.

// write out a basic 'dropdown_link' reference element
var dropdown_link = document.createElement('a');
dropdown_link.className = 'dropdown_link';
dropdown_link.innerHTML = ' <b>+</b>'; // the space is for padding
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the space is padding then you should use &nbsp;.
But, if it's just padding: why not use the css/style for it? i.e. dropdown_link.style["padding-left"]

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

trying to reduce the amount of css required :P

<script type="text/javascript">
(function() {
// write out a basic 'dropdown_link' reference element
var dropdown_link = document.createElement('a');
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why an a link if it doesn't have a href? Should it just be a button instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

button elements add additional CSS. Using a a tag accomplishes what we want with minimal CSS additions.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay. I'm curious what the button css required would need to be; but don't worry about it :)

function(element) {
var dropdown_link_copy = dropdown_link.cloneNode(true);
var list = element.querySelector('ul');
if (!list || list.querySelectorAll('li').length == 1)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

instead of list.querySelectorAll(...).length==1 you could use list.querySelector(...)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The reason I did this was to not hide items that had only one subelement. Either I can remove this entirely or keep it as this; there's no way other than this to detect whether there's n amount of elements.

@coveralls
Copy link

coveralls commented Nov 24, 2016

Coverage Status

Coverage remained the same at 86.332% when pulling ab7d69e on ChickenNuggers:master into 33f482d on daurnimator:master.

2 similar comments
@coveralls
Copy link

coveralls commented Nov 24, 2016

Coverage Status

Coverage remained the same at 86.332% when pulling ab7d69e on ChickenNuggers:master into 33f482d on daurnimator:master.

@coveralls
Copy link

coveralls commented Nov 24, 2016

Coverage Status

Coverage remained the same at 86.332% when pulling ab7d69e on ChickenNuggers:master into 33f482d on daurnimator:master.

@RyanSquared
Copy link
Contributor Author

@daurnimator boop

@daurnimator
Copy link
Owner

A few requests:

  • Could you put the +/- on the left of the list item instead of the right?
  • h1_reason_phrases and http.compat.socket don't seem to get the buttons?
  • It's not super obvious to a first observer that the lists are expandable... perhaps they need to be in a box? or a different colour?

@RyanSquared
Copy link
Contributor Author

RyanSquared commented Dec 5, 2016

Could you put the +/- on the left of the list item instead of the right?

I'm pushing this but it'll probably look a bit weird to some.

h1_reason_phrases and http.compat.socket don't seem to get the buttons?

Fixed.

It's not super obvious to a first observer that the lists are expandable... perhaps they need to be in a box? or a different colour?

I can probably change it to #212121, Google's "Grey 900"

@coveralls
Copy link

coveralls commented Dec 6, 2016

Coverage Status

Coverage remained the same at 86.37% when pulling 07b2c22 on ChickenNuggers:master into 60574ba on daurnimator:master.

Copy link
Owner

@daurnimator daurnimator left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Better :)

However, now you have the list bullet followed by the +/-: could you remove the list bullet? Or alternatively, perhaps the +/- could be the bullet?

Also, the + and - are different widths, so you get some slight movement when expanding/collapsing: could you make it a fixed width (possibly automatically fixed if you make it the bullet)

$endif$
<title>$if(title-prefix)$$title-prefix$ – $endif$$pagetitle$</title>
<style type="text/css">code{white-space: pre;}</style>
<style type="text/css">code{white-space: pre;} b{color: #212121;}</style>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of changing here, could you set dropdown_link.style.color?

@RyanSquared RyanSquared force-pushed the master branch 2 times, most recently from d9c7d6d to 9a49853 Compare December 6, 2016 17:12
@coveralls
Copy link

coveralls commented Dec 7, 2016

Coverage Status

Coverage remained the same at 86.37% when pulling d9c7d6d on ChickenNuggers:master into 60574ba on daurnimator:master.

@coveralls
Copy link

coveralls commented Dec 7, 2016

Coverage Status

Coverage remained the same at 86.37% when pulling 599fa60 on ChickenNuggers:master into 60574ba on daurnimator:master.

@coveralls
Copy link

coveralls commented Dec 7, 2016

Coverage Status

Coverage remained the same at 86.37% when pulling 599fa60 on ChickenNuggers:master into 60574ba on daurnimator:master.

var dropdown_link = document.createElement('a');
dropdown_link.className = 'dropdown_link';
dropdown_link.innerHTML = '<b>+</b>&nbsp;';
dropdown_link.style.color = "#212121";
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

double quotes here (single quotes everywhere else)

@daurnimator daurnimator merged commit 599fa60 into daurnimator:master Dec 7, 2016
daurnimator added a commit that referenced this pull request Dec 7, 2016
daurnimator added a commit that referenced this pull request Dec 7, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants