misskey-awawa/src/client/app/desktop/api/choose-drive-folder.ts

18 lines
429 B
TypeScript
Raw Normal View History

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