From 1119b59886243dabba128ea18a094a0a01cffeec Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 13 Apr 2012 21:42:49 +0200 Subject: [PATCH] codeformat --- htdocs/static/js/stikked.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/htdocs/static/js/stikked.js b/htdocs/static/js/stikked.js index 5e7b851..6b75e7f 100644 --- a/htdocs/static/js/stikked.js +++ b/htdocs/static/js/stikked.js @@ -23,17 +23,18 @@ ST.show = function() { ST.expand = function() { $('.expand').click(function() { - var window_width = $(window).width(); - if(window_width > 900){ - var spacer = 20; //Math.round(window_width / 10); - var new_width = (window_width - (spacer * 3)); - - $('.text_formatted').animate({ - 'width': new_width+'px', - 'left': '-'+(((window_width - 900) / 2 - spacer))+'px' - }, 200); - } - + var window_width = $(window).width(); + var spacer = 20; + if (window_width < 900) { + window_width = 900; + spacer = 0; + } + var new_width = (window_width - (spacer * 3)); + $('.text_formatted').animate({ + 'width': new_width + 'px', + 'left': '-' + (((window_width - 900) / 2 - spacer)) + 'px' + }, + 200); return false; }); };