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 5f2c669568
commit dae3f069ff
9 changed files with 47 additions and 32 deletions

View File

@ -287,7 +287,7 @@ var orbitDesktop = function(dom){
this.layout_data = function(h){
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;
this.layout_data.generate_layout_html = function(l){
$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);
var height_percentage = 100/no_of_entries;
var entries = column_container.find("li[item=true]"),x = 0;
entries.each(function(i,li){
if(x == 0){
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);
x++;
if(x == no_of_entries){
x = 0;
if(entries.length != 0){
entries.each(function(i,li){
if(x == 0){
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);
x++;
if(x == no_of_entries){
x = 0;
temp_div.append(column);
}
})
if(x != 0){
temp_div.append(column);
}
})
if(x != 0){
temp_div.append(column);
}
break;
case "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");
total_columns++;
column.append(ul);
x++;
temp_div.append(column);
})
}
break;
}
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()+")");
if(searchArray.length>0){
$("div#app_manager #seperator").show();
var i = 0;
var $column;
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>');
$("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();}
}).blur(function(){$(this).val("Search");});

View File

@ -436,7 +436,7 @@ a:focus { outline: none; }
.search_result{
float: left;
margin-right: 24px;
max-width: 340px;
/*max-width: 340px;*/
}
.g_sep { width: 11px; border-left: solid 1px #fff; }

View File

@ -10,7 +10,7 @@
</div>
<div class="clear"></div>
</div>
<div class="search_result">
<div class="search_result" style="min-width:120px;">
</div>
<div id="holder">

View File

@ -13,7 +13,7 @@
<div id="panel_l" class="ph">
<div class="s_menu sm_v" content-type="menu">
<ul id='setting_left_nav'>
<li><a href="<%= desktop_publications_books_list_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_publications_books_list_path %>" callback-method="list" class="hh1 w2 hp active thmc1 thmtxt" load="true" onclick='return false;'>List</a></li>
<li><a href="<%= desktop_publications_books_add_path %>" callback-method="addbook" class="admtxt hh1 w2 hp" onclick='return false;'>Add/Edit</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Books</a></li>
<li><a href="" class="admtxt hh1 w2 hp" onclick='return false;'>Co-Authors</a></li>

View File

@ -65,11 +65,8 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<div id="paper_list" class="tinycanvas vp">
<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>
<div class="viewport">
<div class="overview">
<div class="overview" content-layout="datalist" base-width="300">
</div>
</div>
</div>

View File

@ -3,7 +3,7 @@
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<noscript>
<meta http-equiv="refresh" content="0; URL=/compatibility">
<meta http-equiv="refresh" content="0; URL=/desktop/compatibility">
</noscript>
<!--[if lt IE 8]>
<meta http-equiv="refresh" content="0; URL=/compatibility" />

View File

@ -187,7 +187,7 @@ Orbit::Application.routes.draw do
end
end
match "compatibility" => "desktop#compatibility"
match "/desktop/compatibility" => "desktop#compatibility"
match "desktop" => "desktop#index"
match "/desktop/desktop" => "desktop#desktop"
match '/desktop/desktop'=>'desktop#desktop'

View File

@ -6,6 +6,11 @@ class Panel::PersonalJournal::Desktop::JournalPagesController < ApplicationContr
page = params[:page]
page ||= 1
@per_column = 5
if @view_by == "abstract"
@per_column = 1
end
if @view_by.nil?
@writing_journals = @writing_journals.asc(:paper_title)
else

View File

@ -77,11 +77,7 @@
<div class="sdm_t hh1"><span class="icon-question-sign"></span></div>
</div>
</div>
<% if @view_by.eql?"abstract" %>
<div class="overview" content-layout="datalist" per-column="1" base-width="300" pagination-var="page">
<% else %>
<div class="overview" content-layout="datalist" per-column="5" base-width="300" pagination-var="page">
<% end %>
<div class="overview" content-layout="datalist" base-width="300" per-column="<%= @per_column.to_s %>" pagination-var="page" >
<% @writing_journals.each do |w| %>
<%= publication_record w, @view_by%>
<% end %>