I wanted to see the effects of jquery compiled from coffeescript. When writing any coffeescript take notice of how you must use white space.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
|
// coffeescript menuStatus = false $("#showMenu").live 'tap', -> if !menuStatus then $(".ui-page-active").animate marginLeft: "165px", 280, -> menuStatus = true else $(".ui-page-active").animate marginLeft: "0px", 280, -> mentuStatus = false return // compiled jQuery var menuStatus; menuStatus = false; $("a.showMenu").live('tap', function() { if (!menuStatus) { return $(".ui-page-active").animate({ marginLeft: "165px" }, 280, function() { return menuStatus = true; }); } else { return $(".ui-page-active").animate({ marginLeft: "0px" }, 280, function() { var mentuStatus; return mentuStatus = false; }); } }); return; |