Skip to content

Commit

Permalink
Inline Playlist Editor: Rich text same colour as layout's (#2447)
Browse files Browse the repository at this point in the history
  • Loading branch information
maurofmferrao committed Mar 26, 2024
1 parent 6b6db37 commit 974b7a7
Showing 1 changed file with 34 additions and 13 deletions.
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

0 comments on commit 974b7a7

Please sign in to comment.