1
0
mirror of https://github.com/hotomoe/hotomoe synced 2024-12-19 17:18:17 +09:00
hotomoe/src/client/app/desktop/api/choose-drive-folder.ts

17 lines
436 B
TypeScript
Raw Normal View History

2018-05-27 13:49:09 +09:00
import OS from '../../mios';
2018-02-18 12:35:18 +09:00
import MkChooseFolderFromDriveWindow from '../views/components/choose-folder-from-drive-window.vue';
2018-02-17 18:14:23 +09:00
2018-05-27 13:49:09 +09:00
export default (os: OS) => opts => {
2018-02-17 18:14:23 +09:00
return new Promise((res, rej) => {
const o = opts || {};
2018-05-27 13:49:09 +09:00
const w = os.new(MkChooseFolderFromDriveWindow, {
title: o.title,
initFolder: o.currentFolder
});
2018-02-17 18:14:23 +09:00
w.$once('selected', folder => {
res(folder);
});
document.body.appendChild(w.$el);
});
2018-05-27 13:49:09 +09:00
};