Switching to dojo 0.9 is a visible change

There is not much to say, it is a saving! The screenshot below is a diff of a JavaScript file, that used to use dojo 0.4 and now uses the latest (0.9).

Diff dojo 0.4vs0.9

Just click it to see in full size.

The code on the left used dojo 0.4 on the right it’s dojo 0.9. You can see undoubtably that dojo 0.9 makes you write less code. Let’s pick out some things.

dojo.html.toCoordinateObject() has become dojo.coords() great, this always took a lot of time to write, but even better it needs to reference one object less and it has a much shorter name!
The scroll is included, if you set the second parameter (includeScroll) to true you get the scroll already included, you can see in the old code I still did it by hand (though I think it existed there too).
And the padding is included too, you can see that I don’t do any padding calculation anymore additionally.

Kepp going dojo …

RSS feed for comments on this post · TrackBack URL

Leave a Comment