From: Vincent Vanwaelscappel Date: Wed, 22 Feb 2023 09:55:07 +0000 (+0100) Subject: wip #5524 @0.5 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=f33561fb5a50222b37089095563b0d0f85bd7e9b;p=fluidbook-toolbox.git wip #5524 @0.5 --- diff --git a/resources/linkeditor/js/linkeditor.loader.js b/resources/linkeditor/js/linkeditor.loader.js index b64cb9dcc..c40a701f3 100644 --- a/resources/linkeditor/js/linkeditor.loader.js +++ b/resources/linkeditor/js/linkeditor.loader.js @@ -36,9 +36,20 @@ LinkeditorLoader.prototype = { }, togglePagesSource: function () { + var $this = this; this.pagesSource = this.pagesSource === 'pages' ? 'thumbnails' : 'pages'; this.clearPreloads(); - this.preloadPages(); + $(".linkeditor-page").each(function () { + let p = parseInt($(this).attr('data-page')); + if (isNaN(p) || p === 0 || p > FLUIDBOOK_DATA.settings.pages) { + $(this).html(''); + } else { + $this._loadPage(p, $(this)); + } + }); + setTimeout(function () { + $this.preloadPages(); + }, 2000); }, clearPreloads: function () { @@ -70,7 +81,7 @@ LinkeditorLoader.prototype = { if (this.linkeditor.utils.isSpecialPage(p)) { c += ''; } else { - if(this.pagesSource==='pages') { + if (this.pagesSource === 'pages') { if (this.rasterizePages.indexOf(p) >= 0) { c += ''; } else if (this.vectorPages.indexOf(p) >= 0) { @@ -79,7 +90,7 @@ LinkeditorLoader.prototype = { c += ''; c += ''; } - }else if(this.pagesSource==='thumbnails'){ + } else if (this.pagesSource === 'thumbnails') { c += ''; } } diff --git a/resources/views/fluidbook_publication/link_editor.blade.php b/resources/views/fluidbook_publication/link_editor.blade.php index 583ae3ed0..f40526dbd 100644 --- a/resources/views/fluidbook_publication/link_editor.blade.php +++ b/resources/views/fluidbook_publication/link_editor.blade.php @@ -199,7 +199,7 @@ @endif
@if($fluidbook->pdfThumbnails) - @endif