static/app.js
/**
 * Get the location of the element relative to the top left of the documentElement
 *
 * @param {Element} element
 * @return {Object} {top, right, bottom, left} in pixels
 */
Get the location of the element relative to the top left of the documentElement
@param {Element} element
@return {Object} {top, right, bottom, left} in pixels
Get the location of the element relative to the top left of the documentElement @param { Element } element @return { Object } { top right bottom left } in pixels
function position (element) {
	var box = element.getBoundingClientRect()
	  , scrollTop = window.scrollY
	  , scrollLeft = window.scrollX
	return {
		top: box.top + scrollTop,
		right: box.right + scrollLeft,
		left: box.left + scrollLeft,
		bottom: box.bottom + scrollTop,
		width: box.width,
		height: box.height
	}
}
function position ( element ) { var box = element . getBoundingClientRect ( ) , scrollTop = window . scrollY , scrollLeft = window . scrollX return { top : box . top + scrollTop , right : box . right + scrollLeft , left : box . left + scrollLeft , bottom : box . bottom + scrollTop , width : box . width , height : box . height } }
Get the location of the element relative to the top left of the documentElement
 @param {Element} element
 @return {Object} {top, right, bottom, left} in pixels
Get the location of the element relative to the top left of the documentElement @param { Element } element @return { Object } { top right bottom left } in pixels
// Has to be copied since ClientRects is immutable