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

18 lines
429 B
TypeScript
Raw Normal View History

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