1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-06-24 23:26:50 +02:00

Plugins: Allow retrieving form values from dialogs

This commit is contained in:
Laurent Cozic
2020-11-13 18:48:42 +00:00
parent 72472c13c5
commit a647272cf0
7 changed files with 77 additions and 14 deletions

View File

@ -1,6 +1,6 @@
import ViewController from './ViewController';
import shim from '../../shim';
import { ButtonId, ButtonSpec } from './api/types';
import { ButtonSpec, DialogResult } from './api/types';
const { toSystemSlashes } = require('../../path-utils');
export enum ContainerType {
@ -99,7 +99,7 @@ export default class WebviewController extends ViewController {
// Specific to dialogs
// ---------------------------------------------
public async open(): Promise<ButtonId> {
public async open(): Promise<DialogResult> {
this.setStoreProp('opened', true);
return new Promise((resolve: Function, reject: Function) => {
@ -111,7 +111,7 @@ export default class WebviewController extends ViewController {
this.setStoreProp('opened', false);
}
public closeWithResponse(result: ButtonId) {
public closeWithResponse(result: DialogResult) {
this.close();
this.closeResponse_.resolve(result);
}