Code Duplication    Length = 27-28 lines in 2 locations

js/jquery-ui.js 2 locations

@@ 4445-4472 (lines=28) @@
4442
		}
4443
	},
4444
4445
	_getParentOffset: function() {
4446
4447
4448
		//Get the offsetParent and cache its position
4449
		this.offsetParent = this.helper.offsetParent();
4450
		var po = this.offsetParent.offset();
4451
4452
		// This is a special case where we need to modify a offset calculated on start, since the following happened:
4453
		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
4454
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
4455
		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
4456
		if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
4457
			po.left += this.scrollParent.scrollLeft();
4458
			po.top += this.scrollParent.scrollTop();
4459
		}
4460
4461
		// This needs to be actually done for all browsers, since pageX/pageY includes this information
4462
		// with an ugly IE fix
4463
		if( this.offsetParent[0] === document.body || (this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
4464
			po = { top: 0, left: 0 };
4465
		}
4466
4467
		return {
4468
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
4469
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
4470
		};
4471
4472
	},
4473
4474
	_getRelativeOffset: function() {
4475
@@ 1295-1321 (lines=27) @@
1292
		}
1293
	},
1294
1295
	_getParentOffset: function() {
1296
1297
		//Get the offsetParent and cache its position
1298
		var po = this.offsetParent.offset();
1299
1300
		// This is a special case where we need to modify a offset calculated on start, since the following happened:
1301
		// 1. The position of the helper is absolute, so it's position is calculated based on the next positioned parent
1302
		// 2. The actual offset parent is a child of the scroll parent, and the scroll parent isn't the document, which means that
1303
		//    the scroll is included in the initial calculation of the offset of the parent, and never recalculated upon drag
1304
		if(this.cssPosition === "absolute" && this.scrollParent[0] !== document && $.contains(this.scrollParent[0], this.offsetParent[0])) {
1305
			po.left += this.scrollParent.scrollLeft();
1306
			po.top += this.scrollParent.scrollTop();
1307
		}
1308
1309
		//This needs to be actually done for all browsers, since pageX/pageY includes this information
1310
		//Ugly IE fix
1311
		if((this.offsetParent[0] === document.body) ||
1312
			(this.offsetParent[0].tagName && this.offsetParent[0].tagName.toLowerCase() === "html" && $.ui.ie)) {
1313
			po = { top: 0, left: 0 };
1314
		}
1315
1316
		return {
1317
			top: po.top + (parseInt(this.offsetParent.css("borderTopWidth"),10) || 0),
1318
			left: po.left + (parseInt(this.offsetParent.css("borderLeftWidth"),10) || 0)
1319
		};
1320
1321
	},
1322
1323
	_getRelativeOffset: function() {
1324