ukeGeeks.overlapFixer Class
Singleton to correct overlapping chord names/diagrams in songs rendered by UGS
Item Index
Methods
Methods
checkChords
-
codeA
-
codeB
checks (and fixes if problem is presetn) two code tags
Parameters:
-
codeA
DOM_element[description]
-
codeB
DOM_element[description]
Returns:
checkOverlap
-
"a"
-
"b"
returns TRUE if Box A overlaps Box B. Detailed horizontal check, we "cheat" the vertical check by assuming that tops must be equal to collide (a simplification over a full height check.)
Parameters:
-
"a"
Objectbox
-
"b"
Objectbox
Returns:
Fix
-
element
Runs through the element looking for UkeGeek chords (based on HTML) and adjust the horizontal spacing if any of the chords overlap.
Parameters:
-
element
DOM_elementcontaining the UGS HTML song
getBox
-
element
returns object with width and left & right offsets
Parameters:
-
element
DOM_elementto be measured
Returns:
getOffsets
-
element
Returns JSON with left, right, top, and width properties. ONLY left and top are calculate, width & right need to be added later. source: http://stackoverflow.com/questions/442404/dynamically-retrieve-the-position-x-y-of-an-html-element
Parameters:
-
element
DOM_elementto be measured
Returns:
getWidth
-
element
source: http://www.cjboco.com/blog.cfm/post/determining-an-elements-width-and-height-using-javascript/
Parameters:
-
element
DOM_elementto be measured