From a3e83b6da668ae6d34b2b67cf786594bb1f60ec1 Mon Sep 17 00:00:00 2001 From: riccardo Date: Fri, 13 May 2011 11:34:05 +0200 Subject: [PATCH] minor fixies --- telemeta/htdocs/js/application.js | 2 +- telemeta/htdocs/timeside/src/player.js | 52 +++++++------------------- 2 files changed, 15 insertions(+), 39 deletions(-) diff --git a/telemeta/htdocs/js/application.js b/telemeta/htdocs/js/application.js index b2496107..dcca5f26 100644 --- a/telemeta/htdocs/js/application.js +++ b/telemeta/htdocs/js/application.js @@ -360,7 +360,7 @@ function PopupDiv(){ //setting instance-specific properties: for(k in data){ if(k == 'onOk' || k == 'onShow' || k == 'onClose'){ - this.bind(k,data[k]); + this.bind(k.substring(2).toLowerCase(),data[k]); }else if(k == 'content'){ this.setContent(data[k]); }else { diff --git a/telemeta/htdocs/timeside/src/player.js b/telemeta/htdocs/timeside/src/player.js index 5cb1e82f..7cd6db0c 100644 --- a/telemeta/htdocs/timeside/src/player.js +++ b/telemeta/htdocs/timeside/src/player.js @@ -237,8 +237,6 @@ var Player = TimesideClass.extend({ function (){ me.refreshImage.apply(me); }); - select.css('maxHeight',(play.height()-(select.outerHeight(true)-select.height()))+'px'); - var rewind_ = this.rewind; var forward_ = this.forward; @@ -438,43 +436,21 @@ var Player = TimesideClass.extend({ //adjusting select size: + var select = container.find('.ts-visualizer'); + var imgWait = container.find('.ts-wait'); + //NOTE: some buttons might be hidden AFTER THIS METHOD HAS BEEN INVOKED - //TODO: why the line below does not work?!!!!! - //jQueryObjs.find('.ts-control') - // var $J = this.$J; - // var control = $J('#player').find('.ts-control'); - // var imgwait = playerelements.find('.ts-wait').hide(); - // var select = playerelements.find('.ts-visualizer'); - // var maxHeight = control.height(); - // var availableWidth = 0; - // select.siblings().each(function(i,e){ - // var ee = $J(e); - // if(ee.is('a')){ - // availableWidth+=ee.outerWidth(true); - //// consolelog(ee); - //// consolelog(ee.outerWidth()); - // } - // }); - // - // availableWidth = control.width() - availableWidth; - // var both = select.add(imgwait); - // both.css({ - // 'margin':'0px', - // 'width':'', - // 'height':'' - // }); - // - // select.css('maxHeight', (maxHeight-(select.outerHeight(true)-select.height()))+'px'); - // imgwait.css('maxHeight', (maxHeight-(imgwait.outerHeight(true)-imgwait.height()))+'px'); - // var imgMarginTop = (maxHeight- imgwait.outerHeight(true))/2; - // var selectMarginTop = (maxHeight-select.outerHeight(true))/2; - // select.css('marginTop', selectMarginTop+'px'); - // imgwait.css('marginTop', imgMarginTop+'px'); - // - // select.css('maxWidth', (availableWidth-(select.outerWidth(true)-select.width())+'px')); - // imgwait.css('maxWidth', (availableWidth-(imgwait.outerWidth(true)-imgwait.width())+'px')); - // select.css('marginLeft', ((availableWidth-select.outerWidth(true)-selectMarginTop))+'px'); - // imgwait.css('marginLeft', ((availableWidth- imgwait.outerWidth(true) - imgMarginTop))+'px'); + //Therefore, setting the width of select or imgWait is skipped for the moment. + select.css('fontSize','90%'); //this is to increase probability that the select width will fit the available space + + var control = container.find('.ts-control'); + var maxHeight = control.height(); + select.add(imgWait).css('maxHeight',(maxHeight-2)+'px'); //at least a margin left and top of 1 px (see below) + + var span = (maxHeight-select.outerHeight())/2; //do not include margins in oputerHeight (we will set them to zero below) + select.css({'margin':'0px', 'marginTop':span+'px','marginLeft':span+'px'}); + var span2 = (maxHeight - imgWait.outerHeight())/2; //do not include margins in oputerHeight (we will set them to zero below) + imgWait.css({'margin':'0px', 'marginTop':span2+'px','marginLeft':span+'px'}) return this; -- 2.39.5