Minimize bar update

This commit is contained in:
devin chen committed 2013-08-19 06:56:58 +08:00
1 parent 1e73c64ea9
commit 9fff3b9405
5 files changed
+121 -33

No files matched your search

+21 -9
View File
@@ -328,7 +328,7 @@ var orbitDesktop = function(dom){
// }
if($(o.contentHolder).find("div.app_frame").length > 0){
$(o.contentHolder).find("div.app_frame").each(function(){
var app_holder_height = $(this).height() - 72;
var app_holder_height = $(this).height() - 60;
var app_holder_width = $(this).width();
$(this).find("div.app_holder").height(app_holder_height);
$(this).find("div.app_holder iframe").attr({"height":app_holder_height,"width":app_holder_width});
@@ -746,7 +746,7 @@ var orbitDesktop = function(dom){
$("#desktop #group_wrapper").empty();
$.getJSON("/desktop/getgroups",{sectionid:id},function(tiles){
// tiles.sort(o.sortJSON("position",true,parseInt));
var tilecolors = (o.themesettings.tilecolor ? o.themesettings.tilecolor : ["thmc1","thmc2","thmc3","thmc4"]) ;
var tilecolors = ["thmc1","thmc2"];
var totaltiles_in_a_row = 4;
var opacity = ["op07","op08","op09",""];
var row = 0, col = 1, x = 1, y = 1, total_x = 0, prev_y = 0;
@@ -1513,11 +1513,9 @@ var orbitDesktop = function(dom){
}
this.loadWallpaper = function(wallpaper){ // this is to load new wallpaper
if(!wallpaper){
$("#thmbackground").attr("src",o.themesettings.background);
} else {
$("#thmbackground").attr("src",o.wallpaperPath+wallpaper);
}
var img_path = (!wallpaper) ? o.themesettings.background : o.wallpaperPath+wallpaper;
$("#thmbackground").attr("style","background-image: url("+img_path+");");
};
this.loadIconCache = function(){ // this function load or refresh icon cache for the theme
@@ -1834,11 +1832,12 @@ var orbitDesktop = function(dom){
});
minimizeBar.append($e);
win.hide();
miniBarEffect();
// var minimizeOffset = minimizeBar.offset();
// win.animate({"left":minimizeOffset.left + "px","top":minimizeOffset.top + "px","height":"25px","width":"200px"},function(){
// });
$('body').attr('style','');
}
this.minimizeBarManager.maximize = function(win){
var position = minimizedApps.indexOf(win.attr("id"));
@@ -1852,10 +1851,23 @@ var orbitDesktop = function(dom){
}
var generateMiniBar = function(id){
var position = minimizedApps.indexOf(id),
template = '<div id="mini_'+id+'" data-app-id="'+id+'" data-position="'+position+'" style="height:25px; width:200px; bottom:0; margin:3px 3px 3px 3px; float:right; cursor:pointer;" class="minimize thmc2"><span class="thmtxth" style="font-size:18px;margin 3px 3px;" for="title"></span><span class="icon-remove hh2 hp thmtxt" style="float:right;cursor:pointer;"></span></div>',
template = '<div id="mini_'+id+'" data-app-id="'+id+'" data-position="'+position+'" class="minimize w2 hh1 hp admbg admtxt"><span for="title"></span><span class="icon-remove hh1"></span></div>',
$e = $(template);
return $e;
}
var miniBarEffect = function(){
var minimize = $('.minimize'),
normalState = 'admbg admtxt',
hoverState = 'thmc1 thmtxt';
minimize.hover(
function(){
$(this).switchClass(normalState,hoverState, 200);
},
function(){
$(this).switchClass(hoverState,normalState, 200);
}
);
}
var updatePositions = function(){
minimizeBar.find("div.minimize").each(function(){
+36 -6
View File
@@ -158,12 +158,12 @@ var orbitDesktopAPI = function(){
return;
}
}
var whtml =$('<div id="app_frame_'+o.windowcounter+'" class="thmc2 app_frame" data-app="'+settings.appid+'" data-title="'+ settings.title +'"><div class="app_frame_header"><div class="dtitle hh2 hp"><span class="thmtxth">'+settings.title+'</span></div><span class="icon-remove hh2 hp thmtxt"></span><span class="icon-minus hh2 hp thmtxt"></span></div><div id="holder_'+o.windowcounter+'" class="app_holder clear"><iframe src="'+appurl+'" frameborder="0" scrolling="auto"></iframe></div></div>');
$("body").append(whtml);
var parentwindow = $(o.contentHolder).find("#app_frame_"+o.windowcounter);
var app_holder_height = parentwindow.height() - 72;
var whtml = $('<div id="app_frame_'+o.windowcounter+'" class="thmc2 app_frame" data-app="'+settings.appid+'" data-title="'+ settings.title +'"><div class="app_frame_header"><div class="dtitle hh2 hp"><span class="thmtxth">'+settings.title+'</span></div><span class="icon-remove hh2 hp thmtxt"></span><span class="icon-minus hh2 hp thmtxt"></span></div><div id="holder_'+o.windowcounter+'" class="app_holder clear"><iframe src="'+appurl+'" frameborder="0" scrolling="auto"></iframe></div></div>');
$("body").append(whtml).css('overflow','hidden');
var parentwindow = $("#app_frame_"+o.windowcounter);
var app_holder_height = parentwindow.height() - 60;
var app_holder_width = parentwindow.width();
parentwindow.find("iframe").attr({"height":app_holder_height,"width":app_holder_width});
parentwindow.find("iframe").attr({"height":app_holder_height});
parentwindow.find(".app_holder").height(app_holder_height);
parentwindow.find(".icon-remove").click(function(){
o.appWindow.close(parentwindow);
@@ -176,10 +176,40 @@ var orbitDesktopAPI = function(){
this.appWindow.close = function(win){
win.remove();
$('body').attr('style','');
}
this.appWindow.minimize = function(win){
o.minimizeBarManager.minimize(win)
o.minimizeBarManager.minimize(win);
var minimizeBar = $('#minimizebar'),
minimizeHeight = minimizeBar.height();
minimizeBar
.stop(1,1)
.delay(2000)
.animate({
//'bottom': -minimizeHeight
'opacity': 0
}, 900, 'easeInOutQuint');
minimizeBar.on({
mouseenter: function(){
$(this)
.stop(1,1)
.animate({
'opacity': 1
}, 900, 'easeInOutQuint');
},
mouseleave: function(){
$(this)
.stop(1,1)
.delay(2000)
.animate({
//'bottom': -minimizeHeight
'opacity': 0
}, 900, 'easeInOutQuint');
}
});
}
if(typeof callbackfn=="function"){