Fix shadows toggle button

This commit is contained in:
Daniel 2019-10-26 09:37:20 +00:00 committed by Philip Ridout
parent 2ace207485
commit 34eb93f565
2 changed files with 51 additions and 1 deletions

View File

@ -986,7 +986,7 @@ var Display = {
default:
mainStyle["justify-content"] = "center";
}
if (theme.hasOwnProperty('font_main_shadow_size')) {
if (theme.hasOwnProperty('font_main_shadow_size') && !!theme.font_main_shadow) {
mainStyle["text-shadow"] = theme.font_main_shadow_color + " " + theme.font_main_shadow_size + "pt " +
theme.font_main_shadow_size + "pt";
}

View File

@ -583,6 +583,56 @@ describe("Display.setTextSlides", function () {
expect(slidesDiv.style['justify-content']).toEqual('center');
})
it("should enable shadows", function () {
const slides = [
{
"verse": "v1",
"text": "Amazing grace, how sweet the sound\nThat saved a wretch like me\n" +
"I once was lost, but now I'm found\nWas blind but now I see",
"footer": "Public Domain"
}
];
//
const theme = {
'font_main_shadow': true,
'font_main_shadow_color': "#000",
'font_main_shadow_size': 5
};
spyOn(Display, "reinit");
spyOn(Reveal, "slide");
Display.setTheme(theme);
Display.setTextSlides(slides);
const slidesDiv = $(".text-slides")[0];
expect(slidesDiv.style['text-shadow']).not.toEqual('');
})
it("should not enable shadows", function () {
const slides = [
{
"verse": "v1",
"text": "Amazing grace, how sweet the sound\nThat saved a wretch like me\n" +
"I once was lost, but now I'm found\nWas blind but now I see",
"footer": "Public Domain"
}
];
//
const theme = {
'font_main_shadow': false,
'font_main_shadow_color': "#000",
'font_main_shadow_size': 5
};
spyOn(Display, "reinit");
spyOn(Reveal, "slide");
Display.setTheme(theme);
Display.setTextSlides(slides);
const slidesDiv = $(".text-slides")[0];
expect(slidesDiv.style['text-shadow']).toEqual('');
})
it("should correctly set slide size position to theme size when adding a text slide", function () {
const slides = [
{