fix file load touch chain on iOS
This commit is contained in:
parent
989cfbb7da
commit
a193402ccd
4 changed files with 18 additions and 15 deletions
|
|
@ -2157,6 +2157,10 @@ gapp.register("kiri.init", [], (root, exports) => {
|
|||
sliderUpdate();
|
||||
});
|
||||
|
||||
ui.load.onchange = function(event) {
|
||||
api.platform.load_files(event.target.files);
|
||||
};
|
||||
|
||||
ui.sliderMin.onclick = () => {
|
||||
api.show.layer(0,0);
|
||||
}
|
||||
|
|
@ -2744,7 +2748,7 @@ gapp.register("kiri.init", [], (root, exports) => {
|
|||
ui.acct.export.onclick = (ev) => { ev.stopPropagation(); profileExport() };
|
||||
ui.acct.export.title = LANG.acct_xpo;
|
||||
$('file-recent').onclick = () => { api.modal.show('files') };
|
||||
$('file-import').onclick = (ev) => { api.event.import(ev) };
|
||||
$('file-import').onclick = (ev) => { api.event.import(ev); };
|
||||
ui.back.onclick = api.platform.layout;
|
||||
ui.options.trash.onclick = api.selection.delete;
|
||||
ui.options.enable.onclick = api.selection.enable;
|
||||
|
|
|
|||
|
|
@ -531,9 +531,9 @@ gapp.register("kiri.main", [], (root, exports) => {
|
|||
};
|
||||
}
|
||||
|
||||
function loadFile() {
|
||||
function loadFile(ev) {
|
||||
// use modern Filesystem api when available
|
||||
if (window.showOpenFilePicker) {
|
||||
if (false && window.showOpenFilePicker) {
|
||||
window.showOpenFilePicker().then(files => {
|
||||
return Promise.all(files.map(fh => fh.getFile()))
|
||||
}).then(files => {
|
||||
|
|
@ -543,12 +543,7 @@ gapp.register("kiri.main", [], (root, exports) => {
|
|||
}).catch(e => { /* ignore cancel */ });
|
||||
return;
|
||||
}
|
||||
const button = $('load-file');
|
||||
button.onchange = function(event) {
|
||||
console.log(event);
|
||||
api.platform.load_files(event.target.files);
|
||||
};
|
||||
button.click();
|
||||
api.ui.load.click();
|
||||
}
|
||||
|
||||
function saveWorkspace(quiet) {
|
||||
|
|
|
|||
|
|
@ -998,11 +998,15 @@ gapp.register("kiri.ui", [], (root, exports) => {
|
|||
popped = false;
|
||||
};
|
||||
if (opt.auto !== false) {
|
||||
el.addEventListener("mouseenter", openit);
|
||||
el.addEventListener("mouseenter", () => {
|
||||
openit();
|
||||
});
|
||||
el.addEventListener("touchstart", (ev) => {
|
||||
if (ev.target.onclick) {
|
||||
// pass action clicks on children
|
||||
ev.target.onclick(ev);
|
||||
if (mobile && popped) {
|
||||
setTimeout(closeit, 500);
|
||||
return;
|
||||
}
|
||||
}
|
||||
mobile = true;
|
||||
if (popped) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue