public/server/js/server.js in woyo-server-0.0.6 vs public/server/js/server.js in woyo-server-0.0.7
- old
+ new
@@ -1,21 +1,45 @@
$(document).foundation();
$(document).ready( function() {
- $("body").fadeIn('slow');
+
+ var woyo = {
+ time: {
+ page_in: 1000,
+ page_out: 1000,
+ go_slide: 1000,
+ go_fade: 1000,
+ go_delay: 2000
+ }
+ };
+
+ $("body").fadeIn(woyo.time.page_in);
+
$(".way .go").click( function() {
$go_link = $(this);
go_url = $go_link.attr("href");
$.get( go_url, function(json) {
- if ( json.go == true ) {
- $go_link.siblings(".going").text(json.going).fadeIn('slow', function() {
- $("body").fadeOut('slow', function() {
- window.location.reload(true);
- });
+ if ( json.going.length > 0 ) {
+ // fix: animate slide with an easing function that begins and ends less abruptly
+ $go_link.siblings(".going")
+ .text(json.going)
+ .slideDown(woyo.time.go_slide)
+ .animate({opacity: 1}, woyo.time.go_fade)
+ .delay(woyo.time.go_delay).queue( function(next) {
+ if ( json.go == true ) {
+ $("body").fadeOut(woyo.time.page_out, function() {
+ window.location.reload(true);
+ });
+ };
+ next();
});
} else {
- $go_link.siblings(".going").text(json.going).fadeIn('slow');
+ if ( json.go == true ) {
+ $("body").fadeOut(woyo.time.page_out, function() {
+ window.location.reload(true);
+ });
+ };
};
});
return false;
});
});