mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 03:29:02 +01:00 
			
		
		
		
	accept arrays for snapOffset in splitjs
This commit is contained in:
		
							parent
							
								
									3b9bb98d8d
								
							
						
					
					
						commit
						d9a350a003
					
				
							
								
								
									
										2
									
								
								packages/splitjs/index.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								packages/splitjs/index.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -37,7 +37,7 @@ declare namespace Split { | |||||||
|         gutterAlign?: string |         gutterAlign?: string | ||||||
| 
 | 
 | ||||||
|         // Snap to minimum size offset in pixels.
 |         // Snap to minimum size offset in pixels.
 | ||||||
|         snapOffset?: number |         snapOffset?: number | number[] | ||||||
| 
 | 
 | ||||||
|         dragInterval?: number |         dragInterval?: number | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -167,6 +167,7 @@ const Split = (idsOption, options = {}) => { | |||||||
|     const gutterSize = getOption(options, 'gutterSize', 10) |     const gutterSize = getOption(options, 'gutterSize', 10) | ||||||
|     const gutterAlign = getOption(options, 'gutterAlign', 'center') |     const gutterAlign = getOption(options, 'gutterAlign', 'center') | ||||||
|     const snapOffset = getOption(options, 'snapOffset', 30) |     const snapOffset = getOption(options, 'snapOffset', 30) | ||||||
|  |     const snapOffsets = Array.isArray(snapOffset) ? snapOffset : ids.map(() => snapOffset) | ||||||
|     const dragInterval = getOption(options, 'dragInterval', 1) |     const dragInterval = getOption(options, 'dragInterval', 1) | ||||||
|     const direction = getOption(options, 'direction', HORIZONTAL) |     const direction = getOption(options, 'direction', HORIZONTAL) | ||||||
|     const cursor = getOption( |     const cursor = getOption( | ||||||
| @ -297,20 +298,20 @@ const Split = (idsOption, options = {}) => { | |||||||
|         // If within snapOffset of min or max, set offset to min or max.
 |         // If within snapOffset of min or max, set offset to min or max.
 | ||||||
|         // snapOffset buffers a.minSize and b.minSize, so logic is opposite for both.
 |         // snapOffset buffers a.minSize and b.minSize, so logic is opposite for both.
 | ||||||
|         // Include the appropriate gutter sizes to prevent overflows.
 |         // Include the appropriate gutter sizes to prevent overflows.
 | ||||||
|         if (offset <= a.minSize + snapOffset + this[aGutterSize]) { |         if (offset <= a.minSize + a.snapOffset + this[aGutterSize]) { | ||||||
|             offset = a.minSize + this[aGutterSize] |             offset = a.minSize + this[aGutterSize] | ||||||
|         } else if ( |         } else if ( | ||||||
|             offset >= |             offset >= | ||||||
|             this.size - (b.minSize + snapOffset + this[bGutterSize]) |             this.size - (b.minSize + b.snapOffset + this[bGutterSize]) | ||||||
|         ) { |         ) { | ||||||
|             offset = this.size - (b.minSize + this[bGutterSize]) |             offset = this.size - (b.minSize + this[bGutterSize]) | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         if (offset >= a.maxSize - snapOffset + this[aGutterSize]) { |         if (offset >= a.maxSize - a.snapOffset + this[aGutterSize]) { | ||||||
|             offset = a.maxSize + this[aGutterSize] |             offset = a.maxSize + this[aGutterSize] | ||||||
|         } else if ( |         } else if ( | ||||||
|             offset <= |             offset <= | ||||||
|             this.size - (b.maxSize - snapOffset + this[bGutterSize]) |             this.size - (b.maxSize - b.snapOffset + this[bGutterSize]) | ||||||
|         ) { |         ) { | ||||||
|             offset = this.size - (b.maxSize + this[bGutterSize]) |             offset = this.size - (b.maxSize + this[bGutterSize]) | ||||||
|         } |         } | ||||||
| @ -589,6 +590,7 @@ const Split = (idsOption, options = {}) => { | |||||||
|             size: sizes[i], |             size: sizes[i], | ||||||
|             minSize: minSizes[i], |             minSize: minSizes[i], | ||||||
|             maxSize: maxSizes[i], |             maxSize: maxSizes[i], | ||||||
|  |             snapOffset: snapOffsets[i], | ||||||
|             i, |             i, | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Johan Sundström
						Johan Sundström