Skip to content

Commit

Permalink
fix background picker layout when first loaded in image mode
Browse files Browse the repository at this point in the history
  • Loading branch information
Picorims committed Jul 21, 2021
1 parent 7700c55 commit dac5483
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion js/ui_components/ui_parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ export class UIParameterBackgroundPicker extends UIParameter {
this._color_picker = new ui.UIColorPicker(this._input);
this._color_picker.DOM_parent = this._container;
this._color_picker.value = this._defaults.color;
this._color_picker.DOM_container.style.display = (this._defaults.type === "color")? "initial" : "none";

//image display
//using a div make more sense, so it matches the behaviour of the screen,
Expand Down Expand Up @@ -343,7 +344,7 @@ export class UIParameterBackgroundPicker extends UIParameter {

//option choice
let image_UI = [/*this._img_disp,*/ this._img_picker, this._size_mode_picker.DOM_container, this._bgnd_size_inputs, this._repeat_x_input.DOM_container, this._repeat_y_input.DOM_container];
if (this._defaults.type === "image") image_UI.forEach(element => element.style.display = "initial");
if (this._defaults.type === "image") image_UI.forEach(element => element.style.display = (element.tagName === "BUTTON")? "initial":"flex");
else image_UI.forEach(element => element.style.display = "none");
this._list.oninput = () => {
//update UI
Expand Down

0 comments on commit dac5483

Please sign in to comment.