some changes

This commit is contained in:
devin 2012-07-09 15:37:47 +08:00
parent 58d162d225
commit bfedf207c9
1 changed files with 79 additions and 68 deletions

View File

@ -149,7 +149,7 @@ var orbitDesktop = function(dom){
$(window).resize(function(){ $(window).resize(function(){
var ww = $(window).width(); var ww = $(window).width();
$("img#thmbackground").attr({"width":ww}); $("img#thmbackground").attr({"width":ww});
if( $('.tinycanvas') ){ $('.tinycanvas').tinyscrollbar_update(); } if( $('.tinycanvas').length > 0 ){ $('.tinycanvas').tinyscrollbar_update(); }
if($(o.contentHolder).find("div.app_frame").length > 0){ if($(o.contentHolder).find("div.app_frame").length > 0){
$(o.contentHolder).find("div.app_frame").each(function(){ $(o.contentHolder).find("div.app_frame").each(function(){
var app_holder_height = $(this).height() - 72; var app_holder_height = $(this).height() - 72;
@ -254,18 +254,8 @@ var orbitDesktop = function(dom){
.find('.scrollbar') .find('.scrollbar')
.delay(1500) .delay(1500)
.addClass('op00', 500); .addClass('op00', 500);
// simple dropdown menu
var $sdm = $('.sdm'); o.simple_drop_down();
if( !$sdm.children('.sdm_o') ){
return;
} else {
$sdm.hover(function(){
$(this).addClass('thmc2');
}, function(){
$(this).removeClass('thmc2');
});
}
$("div#group_wrapper ul li[data-category=app]").click(function(){ $("div#group_wrapper ul li[data-category=app]").click(function(){
o.appWindow({ o.appWindow({
title : $(this).find("a").attr("href"), title : $(this).find("a").attr("href"),
@ -532,13 +522,7 @@ var orbitDesktop = function(dom){
.delay(1500) .delay(1500)
.addClass('op00', 500); .addClass('op00', 500);
var $sdm = $('.sdm');
if( !$sdm.children('.sdm_o') ){
return;
} else {
$sdm.hover(function(){$(this).addClass('thmc2');}, function(){$(this).removeClass('thmc2');});
}
}; };
var loadApps = function(){ // this loads apps from db to in each sections var loadApps = function(){ // this loads apps from db to in each sections
$.getJSON("/desktop/getapplist",{desktopid:o.desktopId},function(appss){ $.getJSON("/desktop/getapplist",{desktopid:o.desktopId},function(appss){
@ -673,40 +657,6 @@ var orbitDesktop = function(dom){
} }
}); });
}); });
// single select
$('.ssl .ssl_item').each(function(){
var $des = $(this).find('.ssl_des');
$(this).on({
click: function(){
$(this).switchClass('','thmc1 active',0);
$(this).siblings('.thmc1').switchClass('thmc1 active','',0);
if( $des.length > 0 ){
$(this).parents('.ssl').find('.ssl_des').removeClass('thmtxt');
$des.addClass('thmtxt');
}
},
mouseenter: function(){
if( !$(this).hasClass('active') ){
$(this).addClass('thmc1');
if( $des.length > 0 ){
$des.addClass('thmtxt');
}
}
},
mouseleave: function(){
if( !$(this).hasClass('active') ){
$(this).removeClass('thmc1');
if( $des.length > 0 ){
$des.removeClass('thmtxt');
}
}
}
});
});
$('.tinycanvas').each(function(){ $('.tinycanvas').each(function(){
var h = $(this).parent().height(), var h = $(this).parent().height(),
@ -719,21 +669,8 @@ var orbitDesktop = function(dom){
.addClass('op00', 500); .addClass('op00', 500);
}); });
// tab o.single_select();
var $anchor = $('.s_tab a[href*=#]'), o.simple_tab();
$tabcontent = $('.st_c');
$anchor.each(function(){
$(this).click(function(){
var target = $(this).attr('href');
$anchor.removeClass('thmc2 thmtxt admtxt admbg').addClass('admtxt admbg');
$(this).toggleClass('thmc2 thmtxt admtxt admbg');
$tabcontent.hide();
$(target).show();
$('.tinycanvas').tinyscrollbar_update();
return false;
});
});
$('.color-picker').miniColors({ $('.color-picker').miniColors({
change:function(hex){ change:function(hex){
@ -1545,6 +1482,25 @@ var orbitDesktop = function(dom){
o.notify("Wallpaper saving failed!!","imp",2); o.notify("Wallpaper saving failed!!","imp",2);
}) })
}; };
this.tinyscrollbar_ext = function(fill,tinysettings){
tinysettings = ( typeof tinysettings == 'undefined' ) ? {} : tinysettings ;
var count,baseWidth;
if( typeof fill == 'object' ){
count = fill.length;
baseWidth = fill.eq(1).outerWidth(true);
}
fill.parents('.overview').width( baseWidth * count );
$(this)
.css({'height': tinysettings.height })
.tinyscrollbar( tinysettings )
.find('.scrollbar')
.delay(1500)
.addClass('op00', 500);
};
this.simple_drop_down = function(){ this.simple_drop_down = function(){
// simple dropdown menu // simple dropdown menu
if( !$('.sdm').children('.sdm_o').length > 0 ){ if( !$('.sdm').children('.sdm_o').length > 0 ){
@ -1561,6 +1517,61 @@ var orbitDesktop = function(dom){
$(this).stop(1,1).toggleClass('thmc2 thmtxt'); $(this).stop(1,1).toggleClass('thmc2 thmtxt');
}); });
} }
};
this.simple_tab = function(){
// tab
var $anchor = $('.s_tab a[href*=#]'),
$tabcontent = $('.st_c');
$anchor.each(function(){
$(this).click(function(){
var target = $(this).attr('href');
$anchor.removeClass('thmc2 thmtxt admtxt admbg').addClass('admtxt admbg');
$(this).toggleClass('thmc2 thmtxt admtxt admbg');
$tabcontent.hide();
$(target).show();
if( $('.tinycanvas').length > 0 ){
$('.tinycanvas').tinyscrollbar_update();
}
return false;
});
});
};
this.single_select = function(){
// single select
$('.ssl .ssl_item').each(function(){
var $des = $(this).find('.ssl_des');
$(this).on({
click: function(){
$(this).switchClass('','thmc1 active',0);
$(this).siblings('.thmc1').switchClass('thmc1 active','',0);
if( $des.length > 0 ){
$(this).parents('.ssl').find('.ssl_des').removeClass('thmtxt');
$des.addClass('thmtxt');
}
},
mouseenter: function(){
if( !$(this).hasClass('active') ){
$(this).addClass('thmc1');
if( $des.length > 0 ){
$des.addClass('thmtxt');
}
}
},
mouseleave: function(){
if( !$(this).hasClass('active') ){
$(this).removeClass('thmc1');
if( $des.length > 0 ){
$des.removeClass('thmtxt');
}
}
}
});
});
} }
o.initialize(); o.initialize();
} }