tinyscrollbar extension

This commit is contained in:
Harry Bomrah 2012-07-09 17:29:35 +08:00 committed by chris
parent 9333503545
commit 1efb807246
2 changed files with 41 additions and 35 deletions

View File

@ -66,7 +66,6 @@
{
oSelf.update();
setEvents();
return oSelf;
}

View File

@ -608,12 +608,18 @@ var orbitDesktop = function(dom){
$('.tinycanvas').each(function(){
var h = $(this).parent().height(),
sh = $(this).siblings('.s_tab').height();
$(this)
.css({'height': h-sh-24})
.tinyscrollbar({ axis: 'y'})
.find('.scrollbar')
.delay(1500)
.addClass('op00', 500);
o.tinyscrollbar_ext({
main : $(this),
height : h-sh-24,
},{
axis : "y"
})
// $(this)
// .css({'height': h-sh-24})
// .tinyscrollbar({ axis: 'y'})
// .find('.scrollbar')
// .delay(1500)
// .addClass('op00', 500);
});
$("a#name_save_btn").click(function(){
@ -1390,18 +1396,10 @@ var orbitDesktop = function(dom){
var list = function(){
var bindHandlers = function(){
// fill width for tiny scroll bar
var e = $('.list_t'),
count = e.length,
baseWidth = e.eq(1).outerWidth(true);
e.parents('.overview').width( baseWidth * count );
$('.tinycanvas')
.tinyscrollbar({ axis: 'x'})
.find('.scrollbar')
.delay(1500)
.addClass('op00', 500);
o.tinyscrollbar_ext({
main : ".tinycanvas",
fill : ".list_t"
})
}
$("div#seminar_p div#panel_r").load("/desktop/seminar_p_list",function(){
@ -1483,34 +1481,43 @@ var orbitDesktop = function(dom){
o.notify("Wallpaper saving failed!!","imp",2);
})
};
this.tinyscrollbar_ext = function(target,fill,tinysettings){
tinysettings = ( typeof tinysettings == 'undefined' ) ? {} : tinysettings ;
tinysettings.theight = ( typeof tinysettings.theight == 'undefined' ) ? '' : tinysettings.theight ;
this.tinyscrollbar_ext = function(target,tinysettings){
//main : dom on which tinyscrollbar has to be applied
//fill : number or object for width
//height : height for the target element
//tinysettings : tinyscrollbar settings
var count,baseWidth;
if(typeof target.main == "undefined"){
o.notify('tinyscrollbar: target undefined','imp',2);
return;
}else{
target.main = $(target.main);
}
//var target.fill = $
var tinysettings = ( typeof tinysettings == 'undefined' ) ? {"axis":"x"} : tinysettings ;
if( typeof fill == 'object' ){
count = fill.length;
baseWidth = fill.eq(1).outerWidth(true);
fill.parents('.overview').width( baseWidth * count );
var count,baseWidth,fillArray,pxs;
if( typeof target.fill == 'object' ){
fillArray = target.main.find(target.fill);
count = fillArray.length;
baseWidth = fillArray.eq(1).outerWidth(true);
target.main.find('.overview').width( baseWidth * count);
} else if( typeof fill == 'number' ){
fill.parents('.overview').width( fill );
target.main.find('.overview').width( target.fill );
} else if( typeof fill == 'undefined' ){
fill = fill;
} else {
o.notify('tinyscrollbar: setting width failed','imp',2);
}
if(target.height)
target.main.height(target.height);
if( typeof $(target) !== 'undefined' ){
$(target)
target.main
.tinyscrollbar( tinysettings )
.find('.scrollbar')
.delay(1500)
.addClass('op00', 500);
} else {
o.notify('tinyscrollbar: target undefined','imp',2);
}
};
this.simple_drop_down = function(){
// simple dropdown menu