From 769a67f026df5d813878c9b33232c6714be331ee Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 30 Apr 2012 21:17:20 +0800 Subject: [PATCH] the group more structured and also demo connecting with gmail account.. --- app/assets/javascripts/orbitdesktop.js | 116 ++++++++----- app/controllers/otheraccounts_controller.rb | 9 +- app/views/desktop/app_manager.html.erb | 152 +----------------- .../desktop/settings/connections.html.erb | 9 +- public/desktop_widgets/gmail/gmail.js | 9 -- 5 files changed, 87 insertions(+), 208 deletions(-) diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 11f9e132..623f3f6b 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -162,13 +162,15 @@ var orbitDesktop = function(dom){ $.post("/desktop/newpositions",{"sectionid":o.sectionId,"newpos":newpostitions,"groupids":groupids}); }, update:function(){ - var s = $(this).find('.element').length, - last = $(this).find('.element').eq(s-1).position(), - lasth = $(this).find('.element').eq(s-1).outerHeight(true); - - if ((last.top+lasth)>528){ - $(this).sortable('cancel'); - } + var s = $(this).find('.element').length; + if(s!=0){ + last = $(this).find('.element').eq(s-1).position(), + lasth = $(this).find('.element').eq(s-1).outerHeight(true); + + if ((last.top+lasth)>528){ + $(this).sortable('cancel'); + } + }else{$(this).remove();} }, receive: function(event, ui){ @@ -216,39 +218,51 @@ var orbitDesktop = function(dom){ $li, bdsum = 0, bwsum = 0, - bhsum = 0; - + bhsum = 0, + small = 0, + single = false; $group.append($col); - - $.each(group,function(j,tile){ - var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)]; - var op = opacity[Math.floor(Math.random()*opacity.length)]; - if(j==0)$group.attr("id",tile.group_id); - - if(tile.data_category == "app") - $li = $('
  • '+tile.title+'

  • '); - else - $li = $('
  • '+tile.title+'

    Loading...
  • '); - // $group.find("ul").append($li); - - // column experiment start + for(j=0;j 8 ){ - bdsum = 0, bhsum = 0, colindex+=1; + + if(bdsum > 8 || bhsum > 6){ + bdsum = 0, bhsum = 0, colindex++,j--; $group.append('