()
| 129 | } |
| 130 | |
| 131 | export function getScrollbarWidth() { |
| 132 | const outer = document.createElement("div"); |
| 133 | outer.style.visibility = "hidden"; |
| 134 | outer.style.width = "100px"; |
| 135 | outer.style.msOverflowStyle = "scrollbar"; // needed for WinJS apps |
| 136 | document.body.appendChild(outer); |
| 137 | const widthNoScroll = outer.offsetWidth; |
| 138 | outer.style.overflow = "scroll"; |
| 139 | const inner = document.createElement("div"); |
| 140 | inner.style.width = "100%"; |
| 141 | outer.appendChild(inner); |
| 142 | const widthWithScroll = inner.offsetWidth; |
| 143 | outer.parentNode.removeChild(outer); |
| 144 | return widthNoScroll - widthWithScroll; |
| 145 | } |
| 146 | |
| 147 | export function imgToDataURL(url, callback, failedCb) { |
| 148 | const xhr = new XMLHttpRequest(); |
no outgoing calls
no test coverage detected
searching dependent graphs…