Merge branch 'master' into bugfix/nan
This commit is contained in:
Коммит
771477b277
|
@ -380,7 +380,9 @@ export class MenuBar extends ContextedComponent<
|
|||
const inputElement = document.createElement("input");
|
||||
inputElement.type = "file";
|
||||
let file = null;
|
||||
inputElement.accept = ["tmplt"].map((x) => "." + x).join(",");
|
||||
inputElement.accept = ["tmplt", "json"]
|
||||
.map((x) => "." + x)
|
||||
.join(",");
|
||||
// eslint-disable-next-line
|
||||
inputElement.onchange = () => {
|
||||
if (inputElement.files.length == 1) {
|
||||
|
|
|
@ -1443,7 +1443,7 @@ export class FluentUIWidgetManager
|
|||
<ButtonRaised
|
||||
text="Import Template..."
|
||||
onClick={async () => {
|
||||
const file = await showOpenFileDialog(["tmplt"]);
|
||||
const file = await showOpenFileDialog(["tmplt", "json"]);
|
||||
const str = await readFileAsString(file);
|
||||
const data = JSON.parse(str);
|
||||
const template = new ChartTemplate(data);
|
||||
|
|
|
@ -1120,7 +1120,7 @@ export class WidgetManager
|
|||
<ButtonRaised
|
||||
text="Import Template..."
|
||||
onClick={async () => {
|
||||
const file = await showOpenFileDialog(["tmplt"]);
|
||||
const file = await showOpenFileDialog(["tmplt", "json"]);
|
||||
const str = await readFileAsString(file);
|
||||
const data = JSON.parse(str);
|
||||
const template = new ChartTemplate(data);
|
||||
|
|
Загрузка…
Ссылка в новой задаче