mirror of
				https://github.com/KevinMidboe/vue-js-modal.git
				synced 2025-10-29 18:00:20 +00:00 
			
		
		
		
	Fixed resizing when size set with %
This commit is contained in:
		
							
								
								
									
										12
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								dist/index.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							| @@ -124,8 +124,6 @@ | |||||||
|       let width = parseNumber(this.width) |       let width = parseNumber(this.width) | ||||||
|       let height = parseNumber(this.height) |       let height = parseNumber(this.height) | ||||||
|  |  | ||||||
|       console.log(width, height) |  | ||||||
|  |  | ||||||
|       return { |       return { | ||||||
|         visible: false, |         visible: false, | ||||||
|  |  | ||||||
| @@ -241,8 +239,6 @@ | |||||||
|       }, |       }, | ||||||
|  |  | ||||||
|       modalStyle () { |       modalStyle () { | ||||||
|         console.log(this.trueModalWidth, this.trueModalHeight) |  | ||||||
|  |  | ||||||
|         return { |         return { | ||||||
|           top: this.position.top + 'px', |           top: this.position.top + 'px', | ||||||
|           left: this.position.left + 'px', |           left: this.position.left + 'px', | ||||||
| @@ -255,7 +251,6 @@ | |||||||
|       onWindowResize () { |       onWindowResize () { | ||||||
|         this.window.width = window.innerWidth |         this.window.width = window.innerWidth | ||||||
|         this.window.height = window.innerHeight |         this.window.height = window.innerHeight | ||||||
|       //  this.adaptSize() |  | ||||||
|       }, |       }, | ||||||
|  |  | ||||||
|       genEventObject (params) { |       genEventObject (params) { | ||||||
| @@ -272,24 +267,28 @@ | |||||||
|  |  | ||||||
|         return Vue.util.extend(data, params || {}); |         return Vue.util.extend(data, params || {}); | ||||||
|       }, |       }, | ||||||
|  |     /*  | ||||||
|       adaptSize () { |       adaptSize () { | ||||||
|     /*    if (this.adaptive) { |        if (this.adaptive) { | ||||||
|           this.modal.width = inRange(this.minWidth, this.window.width, |           this.modal.width = inRange(this.minWidth, this.window.width, | ||||||
|             this.trueModalWidth) |             this.trueModalWidth) | ||||||
|           this.modal.height = inRange(this.minHeight, this.window.height, |           this.modal.height = inRange(this.minHeight, this.window.height, | ||||||
|             this.trueModalHeight) |             this.trueModalHeight) | ||||||
|         } |         } | ||||||
|     */ |  | ||||||
|       }, |       }, | ||||||
|  |     */ | ||||||
|       onModalResize (event) { |       onModalResize (event) { | ||||||
|  |         this.modal.widthType = 'px' | ||||||
|         this.modal.width = event.size.width |         this.modal.width = event.size.width | ||||||
|  |  | ||||||
|  |         this.modal.heightType = 'px' | ||||||
|         this.modal.height = event.size.height |         this.modal.height = event.size.height | ||||||
|  |  | ||||||
|         const { size } = this.modal |         const { size } = this.modal | ||||||
|         const resizeEvent = this.genEventObject({ size }); |         const resizeEvent = this.genEventObject({ size }); | ||||||
|  |  | ||||||
|  |         console.log(resizeEvent) | ||||||
|  |  | ||||||
|         this.$emit('resize', resizeEvent) |         this.$emit('resize', resizeEvent) | ||||||
|       }, |       }, | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user