From 92427e88315c6c707d7f22dd9316928b127e80d8 Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Thu, 12 Apr 2012 16:25:06 +0800 Subject: [PATCH] =?UTF-8?q?section=20page=20done=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/assets/javascripts/orbitdesktop.js | 24 +++++++++++++++++------- app/views/desktop/index.html.erb | 2 +- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 0377293d..03efc5dd 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -173,7 +173,7 @@ var orbitDesktop = function(dom){ var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)]; var op = opacity[Math.floor(Math.random()*opacity.length)]; if(tile.data_category == "app") - $li = $('
  • '+tile.title+'

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

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

    Loading...
  • '); $group.find("ul").append($li); @@ -293,10 +293,15 @@ var orbitDesktop = function(dom){ this.initializeSectionsManager = function(target){ o.currenthtml = target; o.currentface = "sections"; - var elementParent,element; + var elementParent,element,groupWrapperWidth; var bindHandlers = function(){ $(".group").width(530); - $("#group_wrapper .element").sortable({ + $(".group").each(function(){groupWrapperWidth+=$(this).width();}) + groupWrapperWidth+=200; + // groupWrapperHeight = $(".group").height() + 20; + // groupWrapperHeight = (groupWrapperHeight > ($(window).height()-extraspace))? $(window).height()-extraspace:groupWrapperHeight; + $("#group_wrapper").css("width",groupWrapperWidth); + $("#group_wrapper .to_drop").sortable({ start:function(){ var $elementParent = $(this).parent().parent(); elementParent = $elementParent; @@ -350,13 +355,18 @@ var orbitDesktop = function(dom){ z++; $("div#group_wrapper").append($group); } + var yy=1,y=0; $.each(appss,function(i,apps){ - var y=0; + $.each(apps,function(i,app){ - var $div; - $div = $('

    '+app.title+'

    '); - $("#app_list").append($div); + // alert(yy); + $li = $('
  • '+app.title+'

  • '); + $("ul#section"+yy).append($li); }) + if(y==1){ + y=-1; + yy++; + } y++; }) diff --git a/app/views/desktop/index.html.erb b/app/views/desktop/index.html.erb index 8000f816..d6950c88 100755 --- a/app/views/desktop/index.html.erb +++ b/app/views/desktop/index.html.erb @@ -59,7 +59,7 @@
    -
    +