duplicate error fixed and css inside widgets fixed, duplicate location fixed

This commit is contained in:
Harry Bomrah 2013-04-17 17:53:35 +08:00 committed by Matt K. Fu
parent 209b532129
commit d752af8549
2 changed files with 8 additions and 4 deletions

View File

@ -148,7 +148,6 @@ var orbitDesktop = function(dom){
o.loadWallpaper(customwallpaper); o.loadWallpaper(customwallpaper);
o.bindDesktopEvents(); o.bindDesktopEvents();
o.loadIconCache(); o.loadIconCache();
o.getlocation();
var custom_load = window.location.hash; var custom_load = window.location.hash;
if(!custom_load){ if(!custom_load){
$(o.contentHolder).empty().load("/desktop/desktop",function(){ $(o.contentHolder).empty().load("/desktop/desktop",function(){
@ -438,7 +437,12 @@ var orbitDesktop = function(dom){
// total_width = (!isNaN(base_width) ? ( base_width + 12 ) * total_columns : null); // total_width = (!isNaN(base_width) ? ( base_width + 12 ) * total_columns : null);
return {"markup":temp_div.html(),"width":total_width,"total":entries.length}; return {"markup":temp_div.html(),"width":total_width,"total":entries.length};
} }
var check_container = $("<div></div>").html(h).find("div[container=true]");
if(check_container.length > 0){
$("div[container=true]").html(check_container.html()).find("div.overview").wrap('<div class="tinycanvas"><div class="viewport"></div></div>');
}else{
$("div[container=true]").html(h).find("div.overview").wrap('<div class="tinycanvas"><div class="viewport"></div></div>'); $("div[container=true]").html(h).find("div.overview").wrap('<div class="tinycanvas"><div class="viewport"></div></div>');
}
$("div[container=true]").find("div.tinycanvas").prepend('<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>'); $("div[container=true]").find("div.tinycanvas").prepend('<div class="scrollbar sb_h vp"><div class="track"><div class="thumb thmc2"><div class="end"></div></div></div></div>');
var f = o.layout_data.generate_layout_html(h) var f = o.layout_data.generate_layout_html(h)
$("div[container=true] div.overview").html(f.markup); $("div[container=true] div.overview").html(f.markup);

View File

@ -152,9 +152,9 @@ class DesktopController< ApplicationController
def widget_layout def widget_layout
widget = DesktopWidget.find(params[:id]) widget = DesktopWidget.find(params[:id])
link = '<link href="'+widget.css_default.file.to_s+'" media="screen" rel="stylesheet" type="text/css" />' # link = '<link href="'+widget.css_default.file.to_s+'" media="screen" rel="stylesheet" type="text/css" />'
content = widget.widget_layout.body content = widget.widget_layout.body
dhtml = link + content dhtml = content
render :text => dhtml.html_safe render :text => dhtml.html_safe
end end