app manager changed plus some changes

This commit is contained in:
Harry Bomrah 2013-03-14 17:48:45 +08:00 committed by Matt K. Fu
parent 8dee211ab4
commit 764f83d58c
1 changed files with 33 additions and 16 deletions

View File

@ -287,7 +287,7 @@ var orbitDesktop = function(dom){
this.layout_data = function(h){ this.layout_data = function(h){
var $e; var $e;
var column_container,layout, base_width , no_of_entries, pagination_link , pagination_variable; var column_container,layout, base_width , no_of_entries = 0, pagination_link , pagination_variable;
o.paging = true; o.paging = true;
this.layout_data.generate_layout_html = function(l){ this.layout_data.generate_layout_html = function(l){
$e = $("<div></div>"); $e = $("<div></div>");
@ -305,32 +305,36 @@ var orbitDesktop = function(dom){
no_of_entries = (typeof column_container.attr("per-column") != "undefined"? parseInt(column_container.attr("per-column")) : 4); no_of_entries = (typeof column_container.attr("per-column") != "undefined"? parseInt(column_container.attr("per-column")) : 4);
var height_percentage = 100/no_of_entries; var height_percentage = 100/no_of_entries;
var entries = column_container.find("li[item=true]"),x = 0; var entries = column_container.find("li[item=true]"),x = 0;
entries.each(function(i,li){ if(entries.length != 0){
if(x == 0){ entries.each(function(i,li){
column = $("<div class='column type_datalist' style='width:"+base_width+"px'><ul></ul></div"); if(x == 0){
total_columns++; column = $("<div class='column type_datalist' style='width:"+base_width+"px'><ul></ul></div");
} total_columns++;
$(li).addClass("datalist_item").height(height_percentage+"%"); }
column.find("ul").eq(0).append(li); $(li).addClass("datalist_item").height(height_percentage+"%");
x++; column.find("ul").eq(0).append(li);
if(x == no_of_entries){ x++;
x = 0; if(x == no_of_entries){
x = 0;
temp_div.append(column);
}
})
if(x != 0){
temp_div.append(column); temp_div.append(column);
} }
})
if(x != 0){
temp_div.append(column);
} }
break; break;
case "column": case "column":
var entries = column_container.find("div[column=true]"),x = 0,column; var entries = column_container.find("div[column=true]"),x = 0,column;
entries.each(function(i,ul){ if(entries.length!=0){
entries.each(function(i,ul){
column = $("<div class='column type_column' style='width:"+base_width+"px'></div"); column = $("<div class='column type_column' style='width:"+base_width+"px'></div");
total_columns++; total_columns++;
column.append(ul); column.append(ul);
x++; x++;
temp_div.append(column); temp_div.append(column);
}) })
}
break; break;
} }
var w = (!isNaN(base_width) ? base_width * total_columns : null); var w = (!isNaN(base_width) ? base_width * total_columns : null);
@ -855,10 +859,23 @@ var orbitDesktop = function(dom){
searchArray = $("div#app_manager .element:containsi("+$(this).val()+")"); searchArray = $("div#app_manager .element:containsi("+$(this).val()+")");
if(searchArray.length>0){ if(searchArray.length>0){
$("div#app_manager #seperator").show(); $("div#app_manager #seperator").show();
var i = 0;
var $column;
searchArray.each(function(){ searchArray.each(function(){
i++;
if(i == 1){
$column = $("<div style='width:120px; float:left;'></div>");
}
var $newelement = $('<div class="search element w1 h1 hp vp thmc2" data-category="desktop">'+$(this).html()+'</div>'); var $newelement = $('<div class="search element w1 h1 hp vp thmc2" data-category="desktop">'+$(this).html()+'</div>');
$("div#app_manager .search_result").prepend($newelement); $column.append($newelement);
if(i == 4){
$("div#app_manager .search_result").append($column);
i = 0;
}
}) })
if(i != 0){
$("div#app_manager .search_result").append($column);
}
} }
}else{$("div#app_manager #seperator").hide();$("div#app_manager .search_result").empty();} }else{$("div#app_manager #seperator").hide();$("div#app_manager .search_result").empty();}
}).blur(function(){$(this).val("Search");}); }).blur(function(){$(this).val("Search");});