diff --git a/source/code/hippie/app.js b/source/code/hippie/app.js index cf842a2..81d2494 100644 --- a/source/code/hippie/app.js +++ b/source/code/hippie/app.js @@ -351,12 +351,12 @@ function checkButtonAndTarget(event, element, button = 0) { function getClosestEdgeToElement(element) { 'use strict'; - const rect = element.getBoundingClientRect(); + const bounding = element.getBoundingClientRect(); const distances = { - top: rect.top, - right: window.innerWidth - rect.right, - bottom: window.innerHeight - rect.bottom, - left: rect.left + top: bounding.top, + right: window.innerWidth - bounding.right, + bottom: window.innerHeight - bounding.bottom, + left: bounding.left }; return Object.keys(distances).reduce((a, b) => distances[a] < distances[b] ? a : b); @@ -519,6 +519,10 @@ function convertToRomanNumeral(num) { return result; } +function capitalizeFirstLetter(text) { + return text.charAt(0).toUpperCase() + text.slice(1); +} + // CONCEPTS // NOTE: Benutzt private Zuweisungen