@cursor_el.parentNode.removeChild @cursor_el
@cursor_visible = false
@cursor = null
- @matt null
+ @annotate null
move_cursor: (cursor) ->
@cursor = cursor
unless @cursor_visible
height = cursor.h
@cursor_el.style.top = "#{cursor.y + overlay_padding + Math.round(height * .07)}px"
@cursor_el.style.height = "#{Math.round height * 0.82}px"
- @matt cursor.n
- matt: (n) ->
+ @annotate cursor.n
+ annotate: (n) ->
while @matting.length > 0
@overlay.removeChild @matting[0]
@matting.shift()
if bounds.x is prev_bounds.x and bounds.y is prev_bounds.y and bounds.w is prev_bounds.w and bounds.h is prev_bounds.h
n = n.parent
continue
- matt = domify @outer_idoc, div: class: 'ann_box', style: "left: #{bounds.x - 1 + overlay_padding}px; top: #{bounds.y - 2 + overlay_padding}px; width: #{bounds.w}px; height: #{bounds.h}px" # outline: 1000px solid rgba(0,153,255,#{alpha});
- @overlay.appendChild matt
- @matting.push matt
- ann = domify @outer_idoc, div: class: 'ann_tag', style: "left: #{bounds.x + 1 + overlay_padding}px; top: #{bounds.y - 7 + overlay_padding}px", children: [domify @outer_idoc, text: " #{n.name} "]
- @overlay.appendChild ann
- @matting.push ann
+ ann_box = domify @outer_idoc, div: class: 'ann_box', style: "left: #{bounds.x - 1 + overlay_padding}px; top: #{bounds.y - 2 + overlay_padding}px; width: #{bounds.w}px; height: #{bounds.h}px" # outline: 1000px solid rgba(0,153,255,#{alpha});
+ @overlay.appendChild ann_box
+ @matting.push ann_box
+ ann_tag = domify @outer_idoc, div: class: 'ann_tag', style: "left: #{bounds.x + 1 + overlay_padding}px; top: #{bounds.y - 7 + overlay_padding}px", children: [domify @outer_idoc, text: " #{n.name} "]
+ @overlay.appendChild ann_tag
+ @matting.push ann_tag
n = n.parent
alpha *= 1.5
pretty_html: (tree, indent = '', parent_flags = pre_ish: false, block: true, want_nl: false) ->