From b6266284b4cdc4d7c1d66abba978caa9844a6238 Mon Sep 17 00:00:00 2001 From: devin Date: Mon, 9 Jul 2012 16:20:53 +0800 Subject: [PATCH] dump --- app/assets/javascripts/orbitdesktop.js | 35 +++++++++++++++++++------- 1 file changed, 26 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/orbitdesktop.js b/app/assets/javascripts/orbitdesktop.js index 82ebe221..02092f13 100755 --- a/app/assets/javascripts/orbitdesktop.js +++ b/app/assets/javascripts/orbitdesktop.js @@ -254,6 +254,13 @@ var orbitDesktop = function(dom){ .find('.scrollbar') .delay(1500) .addClass('op00', 500); + o.tinyscrollbar_ext({ + target: '.tinycanvas', + tinysettings: { + + } + }); + o.simple_drop_down(); $("div#group_wrapper ul li[data-category=app]").click(function(){ @@ -261,7 +268,7 @@ var orbitDesktop = function(dom){ title : $(this).find("a").attr("href"), appid : $(this).find("a").attr("href") }); - }) + }); } var loadTiles = function(id){ //This will load tiles for a specific desktop .. id of section has to be passed here to load tiles $("div#desktop div#group_wrapper").empty(); @@ -1482,24 +1489,34 @@ var orbitDesktop = function(dom){ o.notify("Wallpaper saving failed!!","imp",2); }) }; - this.tinyscrollbar_ext = function(fill,tinysettings){ + this.tinyscrollbar_ext = function(target,fill,tinysettings){ tinysettings = ( typeof tinysettings == 'undefined' ) ? {} : tinysettings ; + tinysettings.theight = ( typeof tinysettings.theight == 'undefined' ) ? '' : tinysettings.theight ; var count,baseWidth; if( typeof fill == 'object' ){ count = fill.length; baseWidth = fill.eq(1).outerWidth(true); + fill.parents('.overview').width( baseWidth * count ); + } else if( typeof fill == 'number' ){ + fill.parents('.overview').width( fill ); + } else if( typeof fill == 'undefined' ){ + fill = fill; + } else { + o.notify('tinyscrollbar: setting width failed','imp',2); } - fill.parents('.overview').width( baseWidth * count ); - $(this) - .css({'height': tinysettings.height }) - .tinyscrollbar( tinysettings ) - .find('.scrollbar') - .delay(1500) - .addClass('op00', 500); + if( typeof $(target) !== 'undefined' ){ + $(target) + .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