MCPcopy Create free account
hub / github.com/TruthHun/DocHub / getDimensions

Function getDimensions

static/Home/default/js/flat-ui.js:1054–1082  ·  view source on GitHub ↗
( elem )

Source from the content-addressed store, hash-verified

1052}
1053
1054function getDimensions( elem ) {
1055 var raw = elem[0];
1056 if ( raw.nodeType === 9 ) {
1057 return {
1058 width: elem.width(),
1059 height: elem.height(),
1060 offset: { top: 0, left: 0 }
1061 };
1062 }
1063 if ( $.isWindow( raw ) ) {
1064 return {
1065 width: elem.width(),
1066 height: elem.height(),
1067 offset: { top: elem.scrollTop(), left: elem.scrollLeft() }
1068 };
1069 }
1070 if ( raw.preventDefault ) {
1071 return {
1072 width: 0,
1073 height: 0,
1074 offset: { top: raw.pageY, left: raw.pageX }
1075 };
1076 }
1077 return {
1078 width: elem.outerWidth(),
1079 height: elem.outerHeight(),
1080 offset: elem.offset()
1081 };
1082}
1083
1084$.position = {
1085 scrollbarWidth: function() {

Callers 1

flat-ui.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected