瀏覽代碼

Fixes period dropdown not updating properly

main
Eric Amodio 1 年之前
父節點
當前提交
15aad22c65
共有 1 個文件被更改,包括 7 次插入4 次删除
  1. +7
    -4
      src/webviews/apps/plus/timeline/timeline.ts

+ 7
- 4
src/webviews/apps/plus/timeline/timeline.ts 查看文件

@ -172,10 +172,13 @@ export class TimelineApp extends App {
const $periods = document.getElementById('periods') as HTMLSelectElement;
if ($periods != null) {
const period = this.state?.period;
for (let i = 0, len = $periods.options.length; i < len; ++i) {
if ($periods.options[i].value === period) {
$periods.selectedIndex = i;
break;
const $periodOptions = $periods.getElementsByTagName('vscode-option');
for (const $option of $periodOptions) {
if (period === $option.getAttribute('value')) {
$option.setAttribute('selected', '');
} else {
$option.removeAttribute('selected');
}
}
}

Loading…
取消
儲存