From 7ebc4e759735fd6cc2453aea1e2ec2560395bb50 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 4 Nov 2020 12:42:57 +0100 Subject: [PATCH] wait #4042 @0.15 --- js/libs/fluidbook/fluidbook.sound.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/js/libs/fluidbook/fluidbook.sound.js b/js/libs/fluidbook/fluidbook.sound.js index 47ab87d5..f84e1d20 100644 --- a/js/libs/fluidbook/fluidbook.sound.js +++ b/js/libs/fluidbook/fluidbook.sound.js @@ -11,6 +11,7 @@ function FluidbookSound(fluidbook) { this.on = !!this.fluidbook.settings.soundOn; this.audios = {}; this.playing = null; + this.simpleTheme = this.fluidbook.settings.simpleSoundTheme; this.preloadSounds(); this.initEvents(); @@ -42,7 +43,12 @@ FluidbookSound.prototype = { }, preloadSounds: function () { - var sounds = ['empty', 'cover-flip', 'page-flip-1', 'page-flip-2']; + var sounds; + if (this.simpleTheme) { + sounds = ['empty', 'flip']; + } else { + sounds = ['empty', 'cover-flip', 'page-flip-1', 'page-flip-2']; + } var $this = this; $.each(sounds, function (k, v) { var src; @@ -102,10 +108,14 @@ FluidbookSound.prototype = { } var sound = ''; - if (data.turningPages.indexOf(1) >= 0 || data.turningPages.indexOf(last) >= 0) { - sound = 'cover-flip'; + if (this.simpleTheme) { + sound = 'flip'; } else { - sound = 'page-flip-' + (Math.round(Math.random() + 1)); + if (data.turningPages.indexOf(1) >= 0 || data.turningPages.indexOf(last) >= 0) { + sound = 'cover-flip'; + } else { + sound = 'page-flip-' + (Math.round(Math.random() + 1)); + } } var transitionDuration = this.fluidbook.pagetransitions.getTransitionDuration(page); -- 2.39.5