Skip to content

Commit

Permalink
feat(settings-editor): allow setting the input width
Browse files Browse the repository at this point in the history
  • Loading branch information
MaximBalaganskiy committed Jul 2, 2019
1 parent e50e0db commit b20b0dc
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/elements/settings-editor/i-setting-info.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ export interface ISettingInfo {
description?: string | undefined;
clientEditor: ClientEditor;
children?: ISettingInfo[] | undefined;
width?: string;
}
2 changes: 1 addition & 1 deletion src/elements/settings-editor/settings-editor.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ <h6 class="primary-text" click.delegate="s.toggleExpanded()">${s.info.name}</h6>
<button md-button="flat: true;" class="error-text" click.delegate="cancel(s)"><i class="material-icons">clear</i></button>
<button if.bind="showHistory" md-button="flat: true;" class="blue-text" click.delegate="history(s)"><i class="material-icons">history</i></button>
</div>
<variant-viewer else value.bind="s.value" options.bind="s.info.options" data-type.bind="s.info.clientEditor" edit.delegate="edit(s)" change.delegate="save(s)"></variant-viewer>
<variant-viewer else value.bind="s.value" options.bind="s.info.options" data-type.bind="s.info.clientEditor" edit.delegate="edit(s)" change.delegate="save(s)" width.bind="s.info.width"></variant-viewer>
</div>
</div>
</li>
Expand Down
2 changes: 1 addition & 1 deletion src/elements/variant-viewer/variant-viewer.select.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div style="width: 120px">
<div style="width: ${selectWidth || '120px'}">
<select md-select value.bind="value" change.delegate="change($event)">
<option repeat.for="o of options" model.bind="o.key">${o.value}</option>
</select>
Expand Down
3 changes: 3 additions & 0 deletions src/elements/variant-viewer/variant-viewer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ export class VariantViewer {
@au.bindable
dataType: ClientEditor;

@au.bindable
selectWidth: string = "120px";

@au.bindable
options: ISelectOption[];

Expand Down

0 comments on commit b20b0dc

Please sign in to comment.