refactor
This commit is contained in:
		
							parent
							
								
									9869f01e7c
								
							
						
					
					
						commit
						a8fad1b61c
					
				
					 8 changed files with 24 additions and 24 deletions
				
			
		| 
						 | 
				
			
			@ -72,7 +72,7 @@ export default defineComponent({
 | 
			
		|||
			this.props = {};
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		onContextmenu(e) {
 | 
			
		||||
		onContextmenu(ev: MouseEvent) {
 | 
			
		||||
			os.contextMenu([{
 | 
			
		||||
				type: 'label',
 | 
			
		||||
				text: this.path,
 | 
			
		||||
| 
						 | 
				
			
			@ -103,7 +103,7 @@ export default defineComponent({
 | 
			
		|||
				action: () => {
 | 
			
		||||
					copyToClipboard(this.url);
 | 
			
		||||
				}
 | 
			
		||||
			}], e);
 | 
			
		||||
			}], ev);
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -167,15 +167,15 @@ export default defineComponent({
 | 
			
		|||
			if (window._scroll) window._scroll();
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		onContextmenu(e) {
 | 
			
		||||
		onContextmenu(ev: MouseEvent) {
 | 
			
		||||
			const isLink = (el: HTMLElement) => {
 | 
			
		||||
				if (el.tagName === 'A') return true;
 | 
			
		||||
				if (el.parentElement) {
 | 
			
		||||
					return isLink(el.parentElement);
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
			if (isLink(e.target)) return;
 | 
			
		||||
			if (['INPUT', 'TEXTAREA', 'IMG', 'VIDEO', 'CANVAS'].includes(e.target.tagName) || e.target.attributes['contenteditable']) return;
 | 
			
		||||
			if (isLink(ev.target)) return;
 | 
			
		||||
			if (['INPUT', 'TEXTAREA', 'IMG', 'VIDEO', 'CANVAS'].includes(ev.target.tagName) || ev.target.attributes['contenteditable']) return;
 | 
			
		||||
			if (window.getSelection().toString() !== '') return;
 | 
			
		||||
			const path = this.$route.path;
 | 
			
		||||
			os.contextMenu([{
 | 
			
		||||
| 
						 | 
				
			
			@ -193,7 +193,7 @@ export default defineComponent({
 | 
			
		|||
				action: () => {
 | 
			
		||||
					os.pageWindow(path);
 | 
			
		||||
				}
 | 
			
		||||
			}], e);
 | 
			
		||||
			}], ev);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		onAiClick(ev) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -207,8 +207,8 @@ export default defineComponent({
 | 
			
		|||
			return items;
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		onContextmenu(e) {
 | 
			
		||||
			os.contextMenu(this.getMenu(), e);
 | 
			
		||||
		onContextmenu(ev: MouseEvent) {
 | 
			
		||||
			os.contextMenu(this.getMenu(), ev);
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		goTop() {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -64,15 +64,15 @@ export default defineComponent({
 | 
			
		|||
			history.back();
 | 
			
		||||
		},
 | 
			
		||||
 | 
			
		||||
		onContextmenu(e) {
 | 
			
		||||
		onContextmenu(ev: MouseEvent) {
 | 
			
		||||
			const isLink = (el: HTMLElement) => {
 | 
			
		||||
				if (el.tagName === 'A') return true;
 | 
			
		||||
				if (el.parentElement) {
 | 
			
		||||
					return isLink(el.parentElement);
 | 
			
		||||
				}
 | 
			
		||||
			};
 | 
			
		||||
			if (isLink(e.target)) return;
 | 
			
		||||
			if (['INPUT', 'TEXTAREA', 'IMG', 'VIDEO', 'CANVAS'].includes(e.target.tagName) || e.target.attributes['contenteditable']) return;
 | 
			
		||||
			if (isLink(ev.target)) return;
 | 
			
		||||
			if (['INPUT', 'TEXTAREA', 'IMG', 'VIDEO', 'CANVAS'].includes(ev.target.tagName) || ev.target.attributes['contenteditable']) return;
 | 
			
		||||
			if (window.getSelection().toString() !== '') return;
 | 
			
		||||
			const path = this.$route.path;
 | 
			
		||||
			os.contextMenu([{
 | 
			
		||||
| 
						 | 
				
			
			@ -84,7 +84,7 @@ export default defineComponent({
 | 
			
		|||
				action: () => {
 | 
			
		||||
					os.pageWindow(path);
 | 
			
		||||
				}
 | 
			
		||||
			}], e);
 | 
			
		||||
			}], ev);
 | 
			
		||||
		},
 | 
			
		||||
	}
 | 
			
		||||
});
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue