From: Vincent Vanwaelscappel Date: Wed, 8 Apr 2020 17:00:25 +0000 (+0200) Subject: wip #3577 @0:10 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=77d2ca0d529896a3cf98d20eda81a6455cd9bfad;p=fluidbook-html5.git wip #3577 @0:10 --- diff --git a/js/libs/fluidbook/fluidbook.widget.js b/js/libs/fluidbook/fluidbook.widget.js index 3c1a5886..ebb007a5 100644 --- a/js/libs/fluidbook/fluidbook.widget.js +++ b/js/libs/fluidbook/fluidbook.widget.js @@ -11,6 +11,13 @@ FluidbookWidget.prototype = { if ($_GET['widget'] != '1') { return; } + this.background = false; + if ($_GET.hasOwnProperty('background')) { + this.background = $_GET['background']; + if (this.background !== 'transparent' && this.background.indexOf('rgb') !== 0 && this.background.indexOf('#') !== 0) { + this.background = '#' + this.background; + } + } this.action = $_GET.hasOwnProperty('action') ? $_GET['action'] : 'fullscreen'; this.enabled = true; var $this = this; @@ -50,15 +57,14 @@ FluidbookWidget.prototype = { }, enable: function () { - console.log('enable widget mode'); + $("body").addClass('widget'); - if ($_GET['background'] !== undefined) { - $("#background,#splash").attr('style', 'background-color: ' + $_GET['background'] + ' !important;background-image:none !important'); + if (this.background !== false) { + $("#background,#splash").attr('style', 'background-color: ' + this.background + ' !important;background-image:none !important'); } }, disable: function () { - console.log('disable widget mode'); $("body").removeClass('widget'); $("#background,#splash").attr('style', ''); },