Skip to main content

Search and Top Navigation

#9421 closed bug (duplicate)

Opened July 11, 2013 01:33PM UTC

Closed July 11, 2013 01:35PM UTC

iframe: positions of droppables while dragging from parent not correct.

Reported by: Solid Owned by:
Priority: minor Milestone: none
Component: ui.droppable Version: 1.10.3
Keywords: Cc:
Blocked by: Blocking:
Description

Here is demonstration how this is failing: http://jsfiddle.net/bq9fj/

What's happening is the droppable positions inside are missing its parent iframe offset.

This is a draft of the solution in $.ui.ddmanager.prepareOffsets below m[i].offset :

if (t.document[0] != m[i].document[0]) { 
	var frames = t.document[0].getElementsByTagName('iframe');
	for (var x = frames.length; x-- > 0;) {
		if (frames[x].contentWindow.document === m[i].document[0]) {
			var frame = $(frames[x]).offset();
			m[i].offset.left += frame.left;
			m[i].offset.top += frame.top;
		}
	}
}

here is example of it fixed: http://jsfiddle.net/4C7Kw/

It still needs nested iframe detection.

unlikely for someone to have .draggable > iframe > iframe > .droppable, but is possible for consideration.

Thanks.

Attachments (0)
Change History (1)

Changed July 11, 2013 01:35PM UTC by scottgonzalez comment:1

resolution: → duplicate
status: newclosed

Duplicate of #7925.