summaryrefslogtreecommitdiff
path: root/src/client/app/mobile/api/choose-drive-file.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/client/app/mobile/api/choose-drive-file.ts')
-rw-r--r--src/client/app/mobile/api/choose-drive-file.ts18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/client/app/mobile/api/choose-drive-file.ts b/src/client/app/mobile/api/choose-drive-file.ts
new file mode 100644
index 0000000000..b1a78f2364
--- /dev/null
+++ b/src/client/app/mobile/api/choose-drive-file.ts
@@ -0,0 +1,18 @@
+import Chooser from '../views/components/drive-file-chooser.vue';
+
+export default function(opts) {
+ return new Promise((res, rej) => {
+ const o = opts || {};
+ const w = new Chooser({
+ propsData: {
+ title: o.title,
+ multiple: o.multiple,
+ initFolder: o.currentFolder
+ }
+ }).$mount();
+ w.$once('selected', file => {
+ res(file);
+ });
+ document.body.appendChild(w.$el);
+ });
+}