Explorar el Código

getPositionedAncestor() PoC using HTMLElement.offsetParent.

Aleksander Nowodzinski hace 5 años
padre
commit
ec77cf41f2
Se han modificado 1 ficheros con 16 adiciones y 0 borrados
  1. 16 0
      packages/ckeditor5-utils/src/dom/getpositionedancestor.js

+ 16 - 0
packages/ckeditor5-utils/src/dom/getpositionedancestor.js

@@ -26,3 +26,19 @@ export default function getPositionedAncestor( element ) {
 
 	return null;
 }
+
+// export default function getPositionedAncestor( element ) {
+// 	if ( !element || !element.parentNode ) {
+// 		return null;
+// 	}
+
+// 	if ( element.style.position && element.style.position !== 'static' ) {
+// 		return element;
+// 	}
+
+// 	if ( element.offsetParent === global.document.body ) {
+// 		return null;
+// 	}
+
+// 	return element.offsetParent;
+// }