jQuery.Gantt
jQuery.Gantt copied to clipboard
Cleanup: fix/simplify the construction of navigation markup
This is ugly. (...and doesn't indent well, either!)
The infinite chain of function calls seems wildly unnecessary. The element could just as easily be built using a single string of (much easier to read) markup.
We should also separate the construction of the fragment from the event binding.
Not sure about the best way forward. I'd personally just use a HTML template (clone -> modify -> append), but it's not very "jQuery plugin"-like. I guess the motivation is to just call a function on a <div>
and not have to particularly configure any DOM yourself.
We could use some Template Engine like Handlebars
@mightyuhu I think that might be a bit overkill, seeing as the fix is pretty straightforward and shouldn't require the use of any third-party libraries.