Closed theresaanna closed 10 years ago
Overall, I think this is a pretty smart solution to a complex problem.
@cmc333333 do you mind taking a few minutes this morning to review the JS as well.
Python looks fine. The JS that I could follow seemed okay.
Two suggestions:
checkLinks
function uses recursion to touch all the links. Would it make more sense (and be faster) to use straight iteration? I can't imagine links = links.not(links.last());
being fast on sections with many definitions. Good thinking on running this once per definition load/page update (rather than on scroll)@cmc333333 1) Yeah, I chose recursion for readability only, really. Using the jQuery object probably does slow it down a bit. I will take another look at the whole thing given Adam's input, too. 2) The reason that I didn't put the string in the template (even though it would be much nicer) is that it shouldn't be visible for people looking at just the output sans CSS or JS. Though, now I realize, those people will never see the inline definition anyway, so yes, I think you're right. Re: "notice", good call. I'll use "warning" or something.
If inline definition that is open doesn't apply to all of section, a warning displays. If it doesn't apply to the active paragraph, a link to refresh the definition displays above grayed out definition text.