From 75cbae049bb5ad031cbea7bf27b2e39b91f97990 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Wed, 16 May 2012 11:18:54 +0800 Subject: [PATCH 1/2] =?UTF-8?q?few=20experiments=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Gemfile | 2 +- app/assets/javascripts/orbitdesktop.js | 32 +++++++++++++++++++-- app/controllers/otheraccounts_controller.rb | 11 +++++++ 3 files changed, 41 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index d59de3e8..907187b2 100644 --- a/Gemfile +++ b/Gemfile @@ -26,7 +26,7 @@ gem 'sprockets' gem 'tinymce-rails' gem 'therubyracer' if RUBY_PLATFORM.downcase.include?("linux") gem 'mongoid-encryptor', :require => 'mongoid/encryptor' -# gem 'twitter' +#gem 'contacts' # Gems used only for assets and not required # in production environments by default. diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 9ae7d8b8..d6c55069 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -145,7 +145,7 @@ var orbitDesktop = function(dom){ var bindHandlers = function(){ // this function will bind all the handlers in the desktop var groupWrapperWidth = 0; $("div#desktop .group").each(function(){groupWrapperWidth+=$(this).outerWidth(true);}); - + var grps = new Array; $("div#desktop #group_wrapper").css("width",groupWrapperWidth); var first = true; $("div#desktop .g_col").sortable({ @@ -156,6 +156,27 @@ var orbitDesktop = function(dom){ helper: 'clone', stop:function(){ first = true; + var grpwidth = 0; + for(i in grps){ + var grp = grps[i]; + if(grp.find(".element").length == 0){ + grp.animate({"width":"0px"},500,function(){$(this).remove();}); + grpwidth+=225; + } + } + grps = []; + $("#group_wrapper").width($("#group_wrapper").width()-grpwidth); + }, + start:function(){ + $("#group_wrapper").find("div.group").each(function(i,par){ + var nextnumber = $(this).find("ul").length; + $newcol = $('