Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inline Playlist Editor: Rich text same colour as layout's #2447

Merged
merged 1 commit into from
Mar 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 34 additions & 13 deletions ui/src/helpers/form-helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -539,14 +539,24 @@ const formHelpers = function() {

// COLORS
// Background color for the editor
const backgroundColor =
(
this.mainObject != undefined &&
typeof this.mainObject.backgroundColor != 'undefined' &&
this.mainObject.backgroundColor != null
) ?
this.mainObject.backgroundColor :
this.defaultBackgroundColor;
let backgroundColor = this.defaultBackgroundColor;

// From layout editor
if (
this.mainObject != undefined &&
typeof this.mainObject.backgroundColor != 'undefined' &&
this.mainObject.backgroundColor != null
) {
backgroundColor = this.mainObject.backgroundColor;
}

// From inline playlist editor
if (
this.namespace.inline &&
lD && lD.layout && lD.layout.backgroundColor
) {
backgroundColor = lD.layout.backgroundColor;
}

// Choose a complementary color
const color = $c.complement(backgroundColor);
Expand Down Expand Up @@ -1936,14 +1946,25 @@ const formHelpers = function() {
});

// Add same background colour to editor container as the layout's
const backgroundColor =
(
let backgroundColor = self.defaultBackgroundColor;

// From layout editor
if (
self.mainObject != undefined &&
typeof self.mainObject.backgroundColor != 'undefined' &&
self.mainObject.backgroundColor != null
) ?
self.mainObject.backgroundColor :
self.defaultBackgroundColor;
) {
backgroundColor = self.mainObject.backgroundColor;
}

// From inline playlist editor
if (
self.namespace.inline &&
lD && lD.layout && lD.layout.backgroundColor
) {
backgroundColor = lD.layout.backgroundColor;
}

$editorContainer.parent().css('background-color', backgroundColor);

// Get button container
Expand Down