mirror of
https://github.com/ducbao414/win32.run.git
synced 2025-12-15 08:42:49 +09:00
preload context menus
This commit is contained in:
@@ -29,12 +29,18 @@
|
||||
|
||||
} else if(type == 'Desktop'){
|
||||
menu_obj = (await import('./context_menu/CMDesktop')).make({type, originator});
|
||||
|
||||
} else if(type == 'FSItem'){
|
||||
menu_obj = (await import('./context_menu/CMFSItem')).make({type, originator});
|
||||
|
||||
} else if(type == 'FSVoid'){
|
||||
menu_obj = (await import('./context_menu/CMFSVoid')).make({type, originator});
|
||||
|
||||
} else if(type == 'RecycleBin'){
|
||||
menu_obj = (await import('./context_menu/RecycleBin')).make({type, originator});
|
||||
|
||||
} else {
|
||||
console.log('unknown context menu type')
|
||||
}
|
||||
|
||||
menu = menu_obj.menu;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { onMount, createEventDispatcher } from 'svelte';
|
||||
import {set, get} from 'idb-keyval';
|
||||
import axios from 'axios';
|
||||
import { hardDrive, wallpaper } from '../../lib/store';
|
||||
import { hardDrive, wallpaper, contextMenu } from '../../lib/store';
|
||||
import { bliss_wallpaper, wallpapers_folder } from '../../lib/system';
|
||||
let dispatcher = createEventDispatcher();
|
||||
|
||||
@@ -42,6 +42,8 @@
|
||||
} while (!assets_loaded);
|
||||
|
||||
preload_iframes();
|
||||
preload_context_menus();
|
||||
console.log('after preload_context_menu');
|
||||
|
||||
if(utils.is_installing_windows()){
|
||||
dispatcher('load_page', {url: './installation/95/installing.svelte'});
|
||||
@@ -107,6 +109,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
function preload_context_menus(){
|
||||
let types = ['ProgramTile', 'Desktop', 'FSVoid', 'FSItem', 'RecycleBin'];
|
||||
for(let type of types){
|
||||
contextMenu.set({x: -1000, y: -1000, type, originator: {}});
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<div class="absolute inset-0 bg-black overflow-hidden text-slate-100">
|
||||
|
||||
Reference in New Issue
Block a user