mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2025-11-03 22:21:55 +00:00 
			
		
		
		
	close when clicking outside
This commit is contained in:
		@@ -1,6 +1,6 @@
 | 
			
		||||
<template>
 | 
			
		||||
    <div class="modal">
 | 
			
		||||
        <div>
 | 
			
		||||
        <div @click="handleClick">
 | 
			
		||||
            <div class="modal-container">
 | 
			
		||||
                <slot></slot>
 | 
			
		||||
            </div>
 | 
			
		||||
@@ -23,6 +23,10 @@ export default {
 | 
			
		||||
            } else return;
 | 
			
		||||
            event.preventDefault();
 | 
			
		||||
        },
 | 
			
		||||
        handleClick(event) {
 | 
			
		||||
            if (event.target !== event.currentTarget) return;
 | 
			
		||||
            this.$emit("close");
 | 
			
		||||
        },
 | 
			
		||||
    },
 | 
			
		||||
};
 | 
			
		||||
</script>
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user