section page done…

This commit is contained in:
Harry Bomrah 2012-04-12 16:25:06 +08:00
parent 7b423877bf
commit 92427e8831
2 changed files with 18 additions and 8 deletions

View File

@ -173,7 +173,7 @@ var orbitDesktop = function(dom){
var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)]; var tilecolor = tilecolors[Math.floor(Math.random()*tilecolors.length)];
var op = opacity[Math.floor(Math.random()*opacity.length)]; var op = opacity[Math.floor(Math.random()*opacity.length)];
if(tile.data_category == "app") if(tile.data_category == "app")
$li = $('<li class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><a href="'+tile._id+'" class="appicon"><img src="'+o.iconPath+tile.data_content+'.png" alt="" onclick="return false;" ></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>'); $li = $('<li class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><a href="'+tile._id+'" class="appicon" onclick="return false;"><img src="'+o.iconPath+tile.data_content+'.png" alt="" ></a><h1 class="appname thmtxt">'+tile.title+'</h1></li>');
else else
$li = $('<li class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><h1 class="appname thmtxt">'+tile.title+'</h1><div class="appholder">Loading...</div></li>'); $li = $('<li class="element '+tile.shape+' hp vp" data-category="'+tile.data_category+'" data-content="'+tile.data_content+'"><span class="tile '+tilecolor+' '+op+'"></span><h1 class="appname thmtxt">'+tile.title+'</h1><div class="appholder">Loading...</div></li>');
$group.find("ul").append($li); $group.find("ul").append($li);
@ -293,10 +293,15 @@ var orbitDesktop = function(dom){
this.initializeSectionsManager = function(target){ this.initializeSectionsManager = function(target){
o.currenthtml = target; o.currenthtml = target;
o.currentface = "sections"; o.currentface = "sections";
var elementParent,element; var elementParent,element,groupWrapperWidth;
var bindHandlers = function(){ var bindHandlers = function(){
$(".group").width(530); $(".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(){ start:function(){
var $elementParent = $(this).parent().parent(); var $elementParent = $(this).parent().parent();
elementParent = $elementParent; elementParent = $elementParent;
@ -350,13 +355,18 @@ var orbitDesktop = function(dom){
z++; z++;
$("div#group_wrapper").append($group); $("div#group_wrapper").append($group);
} }
var yy=1,y=0;
$.each(appss,function(i,apps){ $.each(appss,function(i,apps){
var y=0;
$.each(apps,function(i,app){ $.each(apps,function(i,app){
var $div; // alert(yy);
$div = $('<div class="element w1 h1 hp vp thmc2" data-category="'+app.data_category+'" data-content="'+app.data_content+'"><span class="tile thmc2"></span><a href="'+app._id+'" class="appicon"><img src="'+o.iconPath+app.data_content+'.png" alt="" onclick="return false;"></a><h1 class="appname thmtxt">'+app.title+'</h1></div>'); $li = $('<li class="element to_drop w1 hh2 hp vp" data-category="'+app.data_category+'" data-content="'+app.data_content+'"><div class="appicon"><img src="'+o.iconPath+app.data_content+'.png" class="" width="30" /></div><h1 class="appname thmtxth">'+app.title+'</h1></li>');
$("#app_list").append($div); $("ul#section"+yy).append($li);
}) })
if(y==1){
y=-1;
yy++;
}
y++; y++;
}) })