From: Vincent Vanwaelscappel Date: Wed, 4 Sep 2013 10:59:53 +0000 (+0000) Subject: (no commit message) X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=20730d128ef91126127d1ff823635f41c798bd29;p=fluidbook-html5.git --- diff --git a/js/libs/fluidbook/fluidbook.help.js b/js/libs/fluidbook/fluidbook.help.js index c3276f4c..bbd9c112 100644 --- a/js/libs/fluidbook/fluidbook.help.js +++ b/js/libs/fluidbook/fluidbook.help.js @@ -48,15 +48,19 @@ FluidbookHelp.prototype = { }, { preserve: true }); - var h = 40 + ($("#nav>a").length - 1) * 25; - $("nav>a").each(function() { + var h = 40 + ($("#nav a[data-tooltip]").length - 1) * 25; + $("#nav a[data-tooltip]").each(function() { var text = $(this).data('tooltip'); if (text == null || text == undefined || text == '') { return; } - var offset = $(this).position(); - var left = 30 + offset.left; - help += '
' + text + '
'; + var offset = $(this).offset(); + var left = offset.left + ($(this).width() / 2); + var c = 'nav'; + if ($(this).parents("#afterSearch").length > 0) { + c = 'afterSearch'; + } + help += '
' + text + '
'; h -= 25; }); $("#nav").transform({ @@ -188,7 +192,7 @@ FluidbookHelp.prototype = { }); $("#helpView #icons").css({ - fontSize: (16 / navScale) * interfaceScale + fontSize: (14 / navScale) * interfaceScale }); $("#helpView .illustration").transform({ diff --git a/js/libs/fluidbook/fluidbook.js b/js/libs/fluidbook/fluidbook.js index 9b29ed23..fa5fdd4c 100644 --- a/js/libs/fluidbook/fluidbook.js +++ b/js/libs/fluidbook/fluidbook.js @@ -347,6 +347,7 @@ Fluidbook.prototype = { return; }, pageTransition: function(pageNr) { + this.tooltip.hideTooltip(); if (pageNr == undefined) { pageNr = this.currentPage; if (pageNr == -1) { @@ -756,6 +757,7 @@ Fluidbook.prototype = { openingView: function(callback) { var $this = this; this.resize.resizeView(); + this.tooltip.hideTooltip(); var mview = $('#view .mview:last'); @@ -1177,6 +1179,7 @@ Fluidbook.prototype = { this._openFile(pdf, $("#print"), 'pdf', this.datas.pdfName); }, _openFile: function(url, e, type, localname) { + var $this = this; if (this.datas.phonegap != false) { @@ -1194,7 +1197,7 @@ Fluidbook.prototype = { } } - this.wopen(url); + this.wopen(url, '_blank'); }, _downloadFilePhonegap: function(url, localname, fs, callback, callbackArgs) { var $this = this; diff --git a/js/libs/fluidbook/fluidbook.nav.js b/js/libs/fluidbook/fluidbook.nav.js index 0700582d..4ddeb8e5 100644 --- a/js/libs/fluidbook/fluidbook.nav.js +++ b/js/libs/fluidbook/fluidbook.nav.js @@ -1,7 +1,9 @@ function FluidbookNav(fluidbook) { this.fluidbook = fluidbook; this._dimensions = this.fluidbook.datas.iconsDimensions; + this._inited = false; this.setNav(); + } FluidbookNav.prototype = { @@ -36,7 +38,7 @@ FluidbookNav.prototype = { if (className != undefined) { res += ' class="' + className + '"'; } - if (help!=undefined && help != '') { + if (help != undefined && help != '') { res += ' data-tooltip="' + this.fluidbook.l10n.__(help) + '"'; } res += '>'; @@ -45,6 +47,10 @@ FluidbookNav.prototype = { return res; }, setNav: function() { + if (this._inited == true) { + return; + } + this._inited = true; /* * __('overview') * __('chapters') @@ -104,9 +110,9 @@ FluidbookNav.prototype = { }); } } else if (icon == 'pdf' || icon == 'print') { - if (this.fluidbook.datas.print || this.fluidbook.datas.pdf) { + if ($("#print").length==0 && (this.fluidbook.datas.print || this.fluidbook.datas.pdf)) { this.addLink('nav-print', '#', 'print', '!' + this.fluidbook.l10n.__('print') + ' | ' + this.fluidbook.l10n.__('download pdf')); - $("#print").click(function() { + $("#print").on('click', function() { $this.fluidbook.print(); return false; }); diff --git a/js/libs/fluidbook/fluidbook.tooltip.js b/js/libs/fluidbook/fluidbook.tooltip.js index aa24c77f..42dbce84 100644 --- a/js/libs/fluidbook/fluidbook.tooltip.js +++ b/js/libs/fluidbook/fluidbook.tooltip.js @@ -1,6 +1,5 @@ function FluidbookTooltip(fluidbook) { this.fluidbook = fluidbook; - return false; this.init(); } @@ -12,13 +11,17 @@ FluidbookTooltip.prototype = { position.top += $(this).outerHeight() + 20; var text = $(this).data('tooltip'); + if (text.substr(0, 1) == '~') { + var text = $this.fluidbook.l10n.__(text.substring(1)); + $(this).data('tooltip', text); + } var ok = $this.displayTooltip(text, position); if (ok) { $(this).one('mouseout', function() { $this.hideTooltip(); }); } - return true; + return false; }); $("body").append('
'); }, @@ -26,7 +29,7 @@ FluidbookTooltip.prototype = { if (tooltip == undefined || tooltip == '') { return false; } - position.left-=10; + position.left -= 10; $("#tooltip").text(tooltip).css(position).show(); return true; }, diff --git a/style/fluidbook.css b/style/fluidbook.css index 780487cd..1d7be920 100644 --- a/style/fluidbook.css +++ b/style/fluidbook.css @@ -829,7 +829,10 @@ ul.chapters.shareList a.level0 img{ #helpView #icons{ position:absolute; top:0px; - font-size:16px; +} + +.portrait #helpView .icon.afterSearch{ + display:none; } #helpView .icon{ @@ -837,9 +840,8 @@ ul.chapters.shareList a.level0 img{ top:0px; display:inline-block; border-left: 1px solid #ffffff; - text-align: left; - width:400px; padding-left:5px; + white-space: nowrap; } #helpView .interface hr{