From f7ff4a7c7a084edd71adad5420515b1f9ee59002 Mon Sep 17 00:00:00 2001 From: Michael Ang Date: Fri, 12 Nov 2010 04:43:10 +0000 Subject: [PATCH] Put all navigation click handler binding in bindNavigationHandlers. Fixes bug where navigation not bound for borrowed books. --- BookReader/BookReader.js | 114 +++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/BookReader/BookReader.js b/BookReader/BookReader.js index 02b759f..2f0cd7e 100644 --- a/BookReader/BookReader.js +++ b/BookReader/BookReader.js @@ -3406,10 +3406,12 @@ BookReader.prototype.initNavbar = function() { $("#BRzoombtn").draggable({axis:'y',containment:'parent'}); - //XXXmang remove once done testing - //this.addSearchResult("There is a place where the sidewalk ends And before the street begins, And there the grass grows soft and white, And there the sun burns crimson bright,And there the moon-bird rests from his flight To cool in the peppermint wind.", "20", 31); - //this.addSearchResult("There is a place where the sidewalk BEGINS And there the moon-bird rests from his flight To cool in the peppermint wind.", "60", 71); - + /* Initial hiding + $('#BRtoolbar').delay(3000).animate({top:-40}); + $('#BRnav').delay(3000).animate({bottom:-53}); + changeArrow(); + $('.BRnavCntl').delay(3000).animate({height:'43px'}).delay(1000).animate({opacity:.25},1000); + */ } BookReader.prototype.updateNavPageNum = function(index) { @@ -3909,6 +3911,47 @@ BookReader.prototype.bindNavigationHandlers = function() { return false; }); + $('.BRnavCntl').click( + function(){ + if ($('#BRnavCntlBtm').hasClass('BRdn')) { + $('#BRtoolbar').animate({top:-40}); + $('#BRnav').animate({bottom:-55}); + $('#BRnavCntlBtm').addClass('BRup').removeClass('BRdn'); + $('#BRnavCntlTop').addClass('BRdn').removeClass('BRup'); + $('#BRnavCntlBtm.BRnavCntl').animate({height:'45px'}); + $('.BRnavCntl').delay(1000).animate({opacity:.25},1000); + } else { + $('#BRtoolbar').animate({top:0}); + $('#BRnav').animate({bottom:0}); + $('#BRnavCntlBtm').addClass('BRdn').removeClass('BRup'); + $('#BRnavCntlTop').addClass('BRup').removeClass('BRdn'); + $('#BRnavCntlBtm.BRnavCntl').animate({height:'30px'}); + $('.BRvavCntl').animate({opacity:1}) + }; + } + ); + $('#BRnavCntlBtm').mouseover(function(){ + if ($(this).hasClass('BRup')) { + $('.BRnavCntl').animate({opacity:1},250); + }; + }); + $('#BRnavCntlBtm').mouseleave(function(){ + if ($(this).hasClass('BRup')) { + $('.BRnavCntl').animate({opacity:.25},250); + }; + }); + $('#BRnavCntlTop').mouseover(function(){ + if ($(this).hasClass('BRdn')) { + $('.BRnavCntl').animate({opacity:1},250); + }; + }); + $('#BRnavCntlTop').mouseleave(function(){ + if ($(this).hasClass('BRdn')) { + $('.BRnavCntl').animate({opacity:.25},250); + }; + }); + + this.initSwipeData(); $('#BookReader').die('mousemove.navigation').live('mousemove.navigation', { 'br': this }, @@ -4112,6 +4155,16 @@ BookReader.prototype.showNavigation = function() { } } +// changeArrow +//______________________________________________________________________________ +// Change the nav bar arrow +function changeArrow(){ + setTimeout(function(){ + $('#BRnavCntlBtm').removeClass('BRdn').addClass('BRup'); + },3000); +}; + + // firstDisplayableIndex //______________________________________________________________________________ // Returns the index of the first visible page, dependent on the mode. @@ -5038,59 +5091,6 @@ BookReader.prototype.ttsStartPolling = function () { self.ttsNextChunk(); },500); } -//FADING, ETC. - function changeArrow(){ - setTimeout(function(){ - $('#BRnavCntlBtm').removeClass('BRdn').addClass('BRup'); - },3000); - }; - $().ready(function(){ - /* - $('#BRtoolbar').delay(3000).animate({top:-40}); - $('#BRnav').delay(3000).animate({bottom:-53}); - changeArrow(); - $('.BRnavCntl').delay(3000).animate({height:'43px'}).delay(1000).animate({opacity:.25},1000); - */ - $('.BRnavCntl').click( - function(){ - if ($('#BRnavCntlBtm').hasClass('BRdn')) { - $('#BRtoolbar').animate({top:-40}); - $('#BRnav').animate({bottom:-55}); - $('#BRnavCntlBtm').addClass('BRup').removeClass('BRdn'); - $('#BRnavCntlTop').addClass('BRdn').removeClass('BRup'); - $('#BRnavCntlBtm.BRnavCntl').animate({height:'45px'}); - $('.BRnavCntl').delay(1000).animate({opacity:.25},1000); - } else { - $('#BRtoolbar').animate({top:0}); - $('#BRnav').animate({bottom:0}); - $('#BRnavCntlBtm').addClass('BRdn').removeClass('BRup'); - $('#BRnavCntlTop').addClass('BRup').removeClass('BRdn'); - $('#BRnavCntlBtm.BRnavCntl').animate({height:'30px'}); - $('.BRvavCntl').animate({opacity:1}) - }; - } - ); - $('#BRnavCntlBtm').mouseover(function(){ - if ($(this).hasClass('BRup')) { - $('.BRnavCntl').animate({opacity:1},250); - }; - }); - $('#BRnavCntlBtm').mouseleave(function(){ - if ($(this).hasClass('BRup')) { - $('.BRnavCntl').animate({opacity:.25},250); - }; - }); - $('#BRnavCntlTop').mouseover(function(){ - if ($(this).hasClass('BRdn')) { - $('.BRnavCntl').animate({opacity:1},250); - }; - }); - $('#BRnavCntlTop').mouseleave(function(){ - if ($(this).hasClass('BRdn')) { - $('.BRnavCntl').animate({opacity:.25},250); - }; - }); - }); BookReader.prototype.makeShareDiv = function() { -- 2.20.1