few experiments…

This commit is contained in:
Harry Bomrah committed 2012-05-16 11:18:54 +08:00
1 parent 1a9fa8f505
commit 75cbae049b
3 files changed
+41 -4

No files matched your search

+29 -3
View File
@@ -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 = $('<ul class="g_col g_col_w2 col'+nextnumber+' ui-sortable">');
$(this).append($newcol);
$newcol.sortable({connectWith: '.g_col'});
grps.push($newcol);
$("#group_wrapper").width($("#group_wrapper").width()+225);
});
$("div#desktop .g_col").sortable('refresh');
},
update:function(){
if(first){
@@ -180,7 +201,11 @@ var orbitDesktop = function(dom){
if ((last.top+lasth)>528){
$(this).sortable('cancel');
}
}else{$(this).remove();}
}
$("#group_wrapper ul").each(function(){
if($(this).find('.element').length == 0)
$(this).animate({"width":"0px"},500,function(){$(this).remove();});
})
},
receive: function(event, ui){
var s = $(this).find('.element').length,
@@ -1162,6 +1187,7 @@ var orbitDesktop = function(dom){
})
}
$("div#apps_store div#panel_r").load("/desktop_appstore/widgets",function(){
$.getJSON("/desktop_appstore/getuserwidgets",function(userwidgets){
var column = $('<div class="g_col list_t" style="width:350px;"><ul></ul></div>'),
counter = 1,
@@ -1199,7 +1225,7 @@ var orbitDesktop = function(dom){
if(s_name_list_not)
li.find("div.not_status").html("Install on "+s_name_list_not);
}else{
li.find("div.not_status").html("Install on "+o.sectionList[0].name+", "+o.sectionList[1].name+", "+o.sectionList[2].name+", "+o.sectionList[3].name);
li.find("div.not_status").html("Install on <a href='addthis' for='"+o.sectionList[0]._id+"' style='text-decoration:underline;'>"+o.sectionList[0].name+"</a> <a href='addthis' for='"+o.sectionList[1]._id+"' style='text-decoration:underline;'>"+o.sectionList[1].name+"</a> <a href='addthis' for='"+o.sectionList[2]._id+"' style='text-decoration:underline;'>"+o.sectionList[2].name+"</a> <a href='addthis' for='"+o.sectionList[3]._id+"' style='text-decoration:underline;'>"+o.sectionList[3].name)+"</a>";
}
//console.log(section_names);
column.find("ul").append(li);