2018-05-26 23:49:09 -05:00
|
|
|
import OS from '../../mios';
|
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-05-26 23:49:09 -05:00
|
|
|
export default (os: OS) => opts => {
|
2018-02-17 03:14:23 -06:00
|
|
|
return new Promise((res, rej) => {
|
|
|
|
const o = opts || {};
|
2018-05-26 23:49:09 -05:00
|
|
|
const w = os.new(MkChooseFolderFromDriveWindow, {
|
|
|
|
title: o.title,
|
|
|
|
initFolder: o.currentFolder
|
|
|
|
});
|
2018-02-17 03:14:23 -06:00
|
|
|
w.$once('selected', folder => {
|
|
|
|
res(folder);
|
|
|
|
});
|
|
|
|
document.body.appendChild(w.$el);
|
|
|
|
});
|
2018-05-26 23:49:09 -05:00
|
|
|
};
|