mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 19:19:03 +01:00 
			
		
		
		
	drop support for ie 8
This commit is contained in:
		
							parent
							
								
									5d0f64db46
								
							
						
					
					
						commit
						03d6cb58db
					
				| @ -1,6 +1,6 @@ | |||||||
| // The programming goals of Split.js are to deliver readable, understandable and
 | // The programming goals of Split.js are to deliver readable, understandable and
 | ||||||
| // maintainable code, while at the same time manually optimizing for tiny minified file size,
 | // maintainable code, while at the same time manually optimizing for tiny minified file size,
 | ||||||
| // browser compatibility without additional requirements, graceful fallback (IE8 is supported)
 | // browser compatibility without additional requirements
 | ||||||
| // and very few assumptions about the user's page layout.
 | // and very few assumptions about the user's page layout.
 | ||||||
| const global = window | const global = window | ||||||
| const { document } = global | const { document } = global | ||||||
| @ -16,10 +16,6 @@ const bGutterSize = '_c' | |||||||
| const HORIZONTAL = 'horizontal' | const HORIZONTAL = 'horizontal' | ||||||
| const NOOP = () => false | const NOOP = () => false | ||||||
| 
 | 
 | ||||||
| // Figure out if we're in IE8 or not. IE8 will still render correctly,
 |  | ||||||
| // but will be static instead of draggable.
 |  | ||||||
| const isIE8 = global.attachEvent && !global[addEventListener] |  | ||||||
| 
 |  | ||||||
| // Helper function determines which prefixes of CSS calc we need.
 | // Helper function determines which prefixes of CSS calc we need.
 | ||||||
| // We only need to do this once on startup, when this anonymous function is called.
 | // We only need to do this once on startup, when this anonymous function is called.
 | ||||||
| //
 | //
 | ||||||
| @ -92,11 +88,7 @@ const defaultElementStyleFn = (dim, size, gutSize) => { | |||||||
|     const style = {} |     const style = {} | ||||||
| 
 | 
 | ||||||
|     if (!isString(size)) { |     if (!isString(size)) { | ||||||
|         if (!isIE8) { |         style[dim] = `${calc}(${size}% - ${gutSize}px)` | ||||||
|             style[dim] = `${calc}(${size}% - ${gutSize}px)` |  | ||||||
|         } else { |  | ||||||
|             style[dim] = `${size}%` |  | ||||||
|         } |  | ||||||
|     } else { |     } else { | ||||||
|         style[dim] = size |         style[dim] = size | ||||||
|     } |     } | ||||||
| @ -623,30 +615,27 @@ const Split = (idsOption, options = {}) => { | |||||||
|         // staticly assigning sizes without draggable gutters. Assigns a string
 |         // staticly assigning sizes without draggable gutters. Assigns a string
 | ||||||
|         // to `size`.
 |         // to `size`.
 | ||||||
|         //
 |         //
 | ||||||
|         // IE9 and above
 |         // Create gutter elements for each pair.
 | ||||||
|         if (!isIE8) { |         if (i > 0) { | ||||||
|             // Create gutter elements for each pair.
 |             const gutterElement = gutter(i, direction, element.element) | ||||||
|             if (i > 0) { |             setGutterSize(gutterElement, gutterSize, i) | ||||||
|                 const gutterElement = gutter(i, direction, element.element) |  | ||||||
|                 setGutterSize(gutterElement, gutterSize, i) |  | ||||||
| 
 | 
 | ||||||
|                 // Save bound event listener for removal later
 |             // Save bound event listener for removal later
 | ||||||
|                 pair[gutterStartDragging] = startDragging.bind(pair) |             pair[gutterStartDragging] = startDragging.bind(pair) | ||||||
| 
 | 
 | ||||||
|                 // Attach bound event listener
 |             // Attach bound event listener
 | ||||||
|                 gutterElement[addEventListener]( |             gutterElement[addEventListener]( | ||||||
|                     'mousedown', |                 'mousedown', | ||||||
|                     pair[gutterStartDragging], |                 pair[gutterStartDragging], | ||||||
|                 ) |             ) | ||||||
|                 gutterElement[addEventListener]( |             gutterElement[addEventListener]( | ||||||
|                     'touchstart', |                 'touchstart', | ||||||
|                     pair[gutterStartDragging], |                 pair[gutterStartDragging], | ||||||
|                 ) |             ) | ||||||
| 
 | 
 | ||||||
|                 parent.insertBefore(gutterElement, element.element) |             parent.insertBefore(gutterElement, element.element) | ||||||
| 
 | 
 | ||||||
|                 pair.gutter = gutterElement |             pair.gutter = gutterElement | ||||||
|             } |  | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         setElementSize( |         setElementSize( | ||||||
| @ -744,13 +733,6 @@ const Split = (idsOption, options = {}) => { | |||||||
|         }) |         }) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (isIE8) { |  | ||||||
|         return { |  | ||||||
|             setSizes, |  | ||||||
|             destroy, |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     return { |     return { | ||||||
|         setSizes, |         setSizes, | ||||||
|         getSizes, |         getSizes, | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Nathan Cahill
						Nathan Cahill