DevTips / Artists-Theme

🌄 A free Jekyll Theme developed by the DevTips Community
http://devtips.github.io/Artists-Theme
The Unlicense
592 stars 498 forks source link

Refactoring in javascript code #71

Closed piotrhajduga closed 9 years ago

piotrhajduga commented 9 years ago

Reference http://api.jquery.com/jQuery.when/ - I added chaining of actions for showing/hiding work-container. Now the belt is slided only after the work-container is shown/hidden.

It may not be visible at first, but I thought it showcases nicely how you can chain actions whenever needed :)

piotrhajduga commented 9 years ago

Also, after watching the episode about the javascript for the Clients section I refactored the code and removed a looooooot of jquery mumbo-jumbo :)

The code now is based on semi-global position variable that stores the current position. And there is one function setActiveClient that uses this variable to set the proper classes on proper elements. All in one place, DRY :)