Skip to content

Commit

Permalink
Fix linting
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Aug 22, 2024
1 parent b05c848 commit 27715ac
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
3 changes: 1 addition & 2 deletions packages/controls/css/widgets-base.css
Original file line number Diff line number Diff line change
Expand Up @@ -981,7 +981,6 @@
flex-direction: column;
}


/* <DEPRECATED> */
.widget-radio-box-horizontal, /* </DEPRECATED> */
.jupyter-widget-radio-box-horizontal {
Expand All @@ -998,7 +997,7 @@

.widget-radio-box-horizontal label,
.jupyter-widget-radio-box-horizontal label {
margin: 0 calc(var(--jp-widgets-input-padding) * 2) 0 0;
margin: 0 calc(var(--jp-widgets-input-padding) * 2) 0 0;
}

/* <DEPRECATED> */
Expand Down
26 changes: 13 additions & 13 deletions packages/controls/src/widget_selection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ export class RadioButtonsModel extends SelectionModel {
tooltips: [],
icons: [],
button_style: '',
orientation:'vertical',
orientation: 'vertical',
};
}
}
Expand All @@ -306,24 +306,24 @@ export class RadioButtonsView extends DescriptionView {
this.el.appendChild(this.container);
this.container.classList.add('widget-radio-box');

this.update();
this.update();
}

/**
* Update the contents of this view
*
* Called when the model is changed. The model may have been
* changed by another view or by a state update from the back-end.
* Called when the model is changed. The model may have been
* changed by another view or by a state update from the back-end.
*/
update(options?: any): void {
if (this.model.get('orientation') === 'vertical') {
this.container.classList.remove('widget-radio-box-horizontal');
this.container.classList.add('widget-radio-box-vertical');
} else {
this.container.classList.remove('widget-radio-box-vertical');
this.container.classList.add('widget-radio-box-horizontal');
}
const items: string[] = this.model.get('_options_labels');
update(options?: any): void {
if (this.model.get('orientation') === 'vertical') {
this.container.classList.remove('widget-radio-box-horizontal');
this.container.classList.add('widget-radio-box-vertical');
} else {
this.container.classList.remove('widget-radio-box-vertical');
this.container.classList.add('widget-radio-box-horizontal');
}
const items: string[] = this.model.get('_options_labels');
const radios = Array.from(
this.container.querySelectorAll<HTMLInputElement>('input[type="radio"]')
).map((x) => x.value);
Expand Down

0 comments on commit 27715ac

Please sign in to comment.