change behaviour of sidebar

This commit is contained in:
sanj 2010-11-06 21:52:13 +05:30
parent 00ff83db4f
commit 9130d3c65c
4 changed files with 30 additions and 6 deletions

View File

@ -3,7 +3,7 @@
z-index: 3000; z-index: 3000;
border: 1px solid #111; border: 1px solid #111;
background-color: rgb(187,187,87); background-color: rgb(187,187,87);
background-color: rgba(187,187,87,0.7); background-color: rgba(187,187,87,0.9);
padding: 5px; padding: 5px;
opacity: 1; opacity: 1;
border-radius: 10px; border-radius: 10px;

View File

@ -16,7 +16,7 @@ body {
} }
#essay { #essay {
width: 100%; width: 60%;
} }
.para { .para {
@ -30,14 +30,19 @@ h1 {
} }
#padmaSidebar { #padmaSidebar {
width: 0px; width: 400px;
position: fixed; position: fixed;
top: 0px; top: 0px;
right: 0px; right: 0px;
background: #ffffff; background: #000;
bottom: 0px; bottom: 0px;
} }
#aboutTxt {
color: #ccc;
padding: 15px;
}
#padmaSidebarRelative { #padmaSidebarRelative {
position: relative; position: relative;
} }
@ -51,7 +56,7 @@ h1 {
margin-top: 15px; margin-top: 15px;
margin-bottom: 15px; margin-bottom: 15px;
font-size: 13px; font-size: 13px;
height: 420px; height: 35%;
padding: 8px; padding: 8px;
margin-left: 2px; margin-left: 2px;
margin-right: 2px; margin-right: 2px;

View File

@ -74,6 +74,9 @@
</h1> </h1>
<div id="padmaSidebar"> <div id="padmaSidebar">
<div id="padmaSidebarWrapper"></div> <div id="padmaSidebarWrapper"></div>
<div id="aboutTxt">
Abstract / About goes here.
</div>
</div> </div>
<div id="essay"> <div id="essay">

18
test.js
View File

@ -3,6 +3,9 @@ var padmaContainer;
$(function() { $(function() {
padmaContainer = $('#padmaSidebar'); padmaContainer = $('#padmaSidebar');
padmaContainer.data("currentVideo", false); padmaContainer.data("currentVideo", false);
var docWidth = $(document).width();
var essayWidth = docWidth - 440;
$('#essay').css("width", essayWidth);
}); });
function setupPadmaLink(video, data) { function setupPadmaLink(video, data) {
@ -36,19 +39,28 @@ function setupPadmaLink(video, data) {
$a.click(function(e) { $a.click(function(e) {
function sidebarAnimateIn() { function sidebarAnimateIn() {
/*
$container.animate({'width': '400px'}, function() { $container.animate({'width': '400px'}, function() {
$(this).animate({'backgroundColor': '#000000'}); $(this).animate({'backgroundColor': '#000000'});
}); });
var docWidth = $(document).width(); var docWidth = $(document).width();
var newWidth = docWidth - 440; var newWidth = docWidth - 440;
$('#essay').animate({'width': newWidth + "px"}); $('#essay').animate({'width': newWidth + "px"});
*/
// $container.show();
$('#aboutTxt').hide();
} }
function sidebarAnimateOut() { function sidebarAnimateOut() {
$container.find('.padmaViewer').empty();
$('#aboutTxt').show();
/*
$container.animate({'width': '0px'}, function() { $container.animate({'width': '0px'}, function() {
$(this).animate({'backgroundColor': '#ffffff'}); $(this).animate({'backgroundColor': '#ffffff'});
}); });
$('#essay').animate({'width': '100%'}); $('#essay').animate({'width': '100%'});
*/
} }
function isSidebarVisible() { function isSidebarVisible() {
@ -62,9 +74,11 @@ function setupPadmaLink(video, data) {
e.preventDefault(); e.preventDefault();
var currentVideo = $container.data("currentVideo"); var currentVideo = $container.data("currentVideo");
if (currentVideo == video) { if (currentVideo == video) {
/*
if (!isSidebarVisible()) { if (!isSidebarVisible()) {
sidebarAnimateIn(); sidebarAnimateIn();
} }
*/
return; return;
} }
if (currentVideo) { if (currentVideo) {
@ -76,6 +90,7 @@ function setupPadmaLink(video, data) {
} }
var html = tmpl("tmpl_sidebar", {'video': video, 'linkData': linkData}); var html = tmpl("tmpl_sidebar", {'video': video, 'linkData': linkData});
$('#padmaSidebarWrapper').html(html); $('#padmaSidebarWrapper').html(html);
$('#aboutTxt').hide();
//FIXME: should be a better way to deal with displaying default layer. //FIXME: should be a better way to deal with displaying default layer.
var currentLayers = video.getLayersAtTimecode(npt2ms(linkData.tcIn)); var currentLayers = video.getLayersAtTimecode(npt2ms(linkData.tcIn));
@ -119,7 +134,8 @@ function setupPadmaLink(video, data) {
}); });
videoElem.bind("ended", function() { videoElem.bind("ended", function() {
cleanupVideo(videoObj); clearInterval(videoObj.interval);
// cleanupVideo(videoObj);
sidebarAnimateOut(); sidebarAnimateOut();
}); });