API Docs for: 1.4.4
Show:

ukeGeeks.overlapFixer Class

Singleton to correct overlapping chord names/diagrams in songs rendered by UGS

Methods

checkChords

(
  • codeA
  • codeB
)
Void

checks (and fixes if problem is presetn) two code tags

Parameters:

  • codeA DOM_element

    [description]

  • codeB DOM_element

    [description]

Returns:

Void:

checkOverlap

(
  • "a"
  • "b"
)
Boolean

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" Object

    box

  • "b" Object

    box

Returns:

Boolean:

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_element

    containing the UGS HTML song

getBox

(
  • element
)
Object

returns object with width and left & right offsets

Parameters:

  • element DOM_element

    to be measured

Returns:

Object:

getOffsets

(
  • element
)
JSON

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_element

    to be measured

Returns:

JSON:

getWidth

(
  • element
)
Int

Parameters:

  • element DOM_element

    to be measured

Returns:

Int: