mirror of
				https://github.com/KevinMidboe/vue-js-modal.git
				synced 2025-10-29 18:00:20 +00:00 
			
		
		
		
	Adding overflow:hidden to the body when "scrollable" is enabled. #71
This commit is contained in:
		
							
								
								
									
										23
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										23
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										23
									
								
								dist/ssr.index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										23
									
								
								dist/ssr.index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -1,7 +1,7 @@ | ||||
| { | ||||
|   "name": "vue-js-modal", | ||||
|   "description": "Modal Component for Vue.js", | ||||
|   "version": "1.2.9", | ||||
|   "version": "1.2.10", | ||||
|   "author": "euvl <yev.vlasenko@gmail.com>", | ||||
|   "main": "dist/index.js", | ||||
|   "repository": { | ||||
|   | ||||
| @@ -369,7 +369,7 @@ | ||||
|        * Event handler which is triggered on $modal.show and $modal.hight | ||||
|        */ | ||||
|       toggle (state, params) { | ||||
|         const { reset, visible } = this | ||||
|         const { reset, scrollable, visible } = this | ||||
|  | ||||
|         const beforeEventName = visible | ||||
|           ? 'before-close' | ||||
| @@ -379,10 +379,22 @@ | ||||
|           ? 'closed' | ||||
|           : 'opened' | ||||
|  | ||||
|         if (beforeEventName === 'before-open' && reset) { | ||||
|           this.setInitialSize() | ||||
|           this.shift.left = 0 | ||||
|           this.shift.top = 0 | ||||
|         if (beforeEventName === 'before-open') { | ||||
|           if (reset) { | ||||
|             this.setInitialSize() | ||||
|             this.shift.left = 0 | ||||
|             this.shift.top = 0 | ||||
|           } | ||||
|  | ||||
|           if (scrollable) { | ||||
|             document.body.classList.add('v--modal-block-scroll') | ||||
|           } | ||||
|         } | ||||
|  | ||||
|         if (beforeEventName === 'before-close') { | ||||
|           if (scrollable) { | ||||
|             document.body.classList.remove('v--modal-block-scroll') | ||||
|           } | ||||
|         } | ||||
|  | ||||
|         let stopEventExecution = false | ||||
| @@ -489,6 +501,10 @@ | ||||
|   } | ||||
| </script> | ||||
| <style> | ||||
|   .v--modal-block-scroll { | ||||
|     overflow: hidden; | ||||
|   } | ||||
|  | ||||
|   .v--modal-overlay { | ||||
|     position: fixed; | ||||
|     box-sizing: border-box; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user