mirror of
				https://github.com/flynx/ImageGrid.git
				synced 2025-10-31 03:10:07 +00:00 
			
		
		
		
	more jQuery3 related fixes...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
		
							parent
							
								
									70859e9341
								
							
						
					
					
						commit
						f61926171a
					
				| @ -112,8 +112,10 @@ var SingleImageActions = actions.Actions({ | |||||||
| 			var viewer = this.ribbons.viewer | 			var viewer = this.ribbons.viewer | ||||||
| 			var img = this.ribbons.getImage() | 			var img = this.ribbons.getImage() | ||||||
| 
 | 
 | ||||||
| 			var w = img.outerWidth() | 			//* XXX these do not account for margins....
 | ||||||
| 			var h = img.outerHeight() | 			var s = getComputedStyle(img[0]) | ||||||
|  | 			var w = parseFloat(s.width) | ||||||
|  | 			var h = parseFloat(s.height) | ||||||
| 
 | 
 | ||||||
| 			// inner diameter
 | 			// inner diameter
 | ||||||
| 			var di = Math.min(h, w) | 			var di = Math.min(h, w) | ||||||
|  | |||||||
| @ -2236,15 +2236,15 @@ var RibbonsPrototype = { | |||||||
| 
 | 
 | ||||||
| 		var viewer_p = W > H ? 'landscape' : 'portrait' | 		var viewer_p = W > H ? 'landscape' : 'portrait' | ||||||
| 
 | 
 | ||||||
| 		var scale = this.scale() |  | ||||||
| 
 |  | ||||||
| 		return $(images).each(function(i, e){ | 		return $(images).each(function(i, e){ | ||||||
| 			var image = $(this) | 			var image = $(this) | ||||||
| 			// orientation...
 | 			// orientation...
 | ||||||
| 			var o = image.attr('orientation') | 			var o = image.attr('orientation') | ||||||
| 			o = o == null ? 0 : o | 			o = o == null ? 0 : o | ||||||
| 			var w = image.outerWidth() / scale | 
 | ||||||
| 			var h = image.outerHeight() / scale | 			var s = getComputedStyle(image[0]) | ||||||
|  | 			var w = parseFloat(s.width) | ||||||
|  | 			var h = parseFloat(s.height)  | ||||||
| 
 | 
 | ||||||
| 			// non-square image...
 | 			// non-square image...
 | ||||||
| 			if(w != h){ | 			if(w != h){ | ||||||
| @ -2301,12 +2301,19 @@ var RibbonsPrototype = { | |||||||
| 
 | 
 | ||||||
| 		//this.origin(target)
 | 		//this.origin(target)
 | ||||||
| 		 | 		 | ||||||
|  | 		var o = target.attr('orientation') | ||||||
|  | 		o = o == null ? 0 : o | ||||||
|  | 
 | ||||||
| 		var ro = ribbon_set.offset().top | 		var ro = ribbon_set.offset().top | ||||||
| 		// NOTE: this appears to account for margins...
 | 		// NOTE: this appears to account for margins...
 | ||||||
| 		var io = target.offset().top  | 		var io = target.offset().top  | ||||||
| 		var h = target.outerHeight() / scale  | 
 | ||||||
| 			+ parseFloat(target.css('margin-top')) | 		// NOTE: we are not using .outerHeight(true) here as it returns 
 | ||||||
| 			+ parseFloat(target.css('margin-bottom')) | 		// 		the visible size rather than the real size, so we'll 
 | ||||||
|  | 		// 		need to first divide by current scale and then multiply
 | ||||||
|  | 		// 		by the given scale which will introduce errors...
 | ||||||
|  | 		var s = getComputedStyle(target[0]) | ||||||
|  | 		var h = parseFloat(o == 0 || o == 180 ? s.height : s.width)  | ||||||
| 
 | 
 | ||||||
| 		var t = (io - ro)/scale + h/2 | 		var t = (io - ro)/scale + h/2 | ||||||
| 
 | 
 | ||||||
| @ -2335,13 +2342,21 @@ var RibbonsPrototype = { | |||||||
| 			return this | 			return this | ||||||
| 		} | 		} | ||||||
| 
 | 
 | ||||||
|  | 		var o = target.attr('orientation') | ||||||
|  | 		o = o == null ? 0 : o | ||||||
|  | 
 | ||||||
| 		var rl = ribbon.offset().left | 		var rl = ribbon.offset().left | ||||||
| 		// NOTE: this appears to account for margins...
 | 		// NOTE: this appears to account for margins...
 | ||||||
| 		var il = target.offset().left  | 		var il = target.offset().left  | ||||||
|  | 
 | ||||||
| 		var W = this.viewer.width() * scale | 		var W = this.viewer.width() * scale | ||||||
| 		var w = (target.outerWidth() / scale | 
 | ||||||
| 			+ parseFloat(target.css('margin-left')) | 		// NOTE: we are not using .outerWidth(true) here as it returns 
 | ||||||
| 			+ parseFloat(target.css('margin-right'))) * scale | 		// 		the visible size rather than the real size, so we'll 
 | ||||||
|  | 		// 		need to first divide by current scale and then multiply
 | ||||||
|  | 		// 		by the given scale which will introduce errors...
 | ||||||
|  | 		var s = getComputedStyle(target[0]) | ||||||
|  | 		var w = parseFloat(o == 0 || o == 180 ? s.width : s.height) * scale | ||||||
| 
 | 
 | ||||||
| 		var image_offset = mode == 'before' ? w/2 | 		var image_offset = mode == 'before' ? w/2 | ||||||
| 			: mode == 'after' ? -w/2 | 			: mode == 'after' ? -w/2 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user