MCPcopy Create free account
hub / github.com/controlsjs/controls.js / ng_BeginMeasureElement

Function ng_BeginMeasureElement

src/ng_basic/basic.js:1666–1696  ·  view source on GitHub ↗

* Function: ng_BeginMeasureElement * Prepares element for dimension measurement. * Makes sure all parent object have proper display style. * * Syntax: * array *ng_BeginMeasureElement* (object elm) * * Parameters: * elm - object element * * Returns: * List of modi

(o)

Source from the content-addressed store, hash-verified

1664 * <ng_EndMeasureElement>
1665 */
1666function ng_BeginMeasureElement(o)
1667{
1668 if((o)&&((!o.offsetHeight)||(!o.offsetWidth)))
1669 {
1670 if(typeof o.measure_info !== 'undefined') return o.measure_info;
1671
1672 var arr = new Array();
1673 var p = o;
1674 var displaystyle=(ngIExplorer ? '' : 'inherit');
1675 //iterate through parent nodes
1676 while((p)&&(p!=document))
1677 {
1678 if(typeof p.measure_info !== 'undefined') break;
1679 if((p)&&(p.style)&&(p.style.display === 'none')) //if display is none save parent and change it to inherit
1680 {
1681 arr.push(p);
1682 p.style.display = displaystyle;
1683 }
1684 p = p.parentNode;
1685 }
1686 //compute height and width again
1687 var fix7=o.offsetLeft; //IE fix
1688
1689 if(arr.length)
1690 {
1691 o.measure_info = arr;
1692 return arr;
1693 }
1694 }
1695 return undefined;
1696}
1697
1698/**
1699 * Function: ng_EndMeasureElement

Callers 15

ng_OuterWidthFunction · 0.85
ng_OuterHeightFunction · 0.85
ng_ClientWidthFunction · 0.85
ng_ClientHeightFunction · 0.85
ngmn_DoPopupFunction · 0.85
ngmn_PopupFunction · 0.85
ngmn_PopupCtrlFunction · 0.85
ngmn_PopupSubMenuFunction · 0.85
ngap_UpdateFunction · 0.85
ngc_UpdateFunction · 0.85
ngb_DoUpdateFunction · 0.85
nge_DropDownFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected