From 77d2ca0d529896a3cf98d20eda81a6455cd9bfad Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 8 Apr 2020 19:00:25 +0200 Subject: [PATCH] wip #3577 @0:10 --- js/libs/fluidbook/fluidbook.widget.js | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) 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', ''); }, -- 2.39.5