JasonWoof Got questions, comments, patches, etc.? Contact Jason Woofenden
code cleanup: var/func renames
authorJason Woofenden <jason@jasonwoof.com>
Fri, 18 Mar 2016 17:58:14 +0000 (13:58 -0400)
committerJason Woofenden <jason@jasonwoof.com>
Fri, 18 Mar 2016 17:58:14 +0000 (13:58 -0400)
editor.coffee

index 0d9d495..a932f16 100644 (file)
@@ -889,7 +889,7 @@ class PeachHTML5Editor
                        @cursor_el.parentNode.removeChild @cursor_el
                        @cursor_visible = false
                @cursor = null
                        @cursor_el.parentNode.removeChild @cursor_el
                        @cursor_visible = false
                @cursor = null
-               @matt null
+               @annotate null
        move_cursor: (cursor) ->
                @cursor = cursor
                unless @cursor_visible
        move_cursor: (cursor) ->
                @cursor = cursor
                unless @cursor_visible
@@ -903,8 +903,8 @@ class PeachHTML5Editor
                        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"
                        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()
                while @matting.length > 0
                        @overlay.removeChild @matting[0]
                        @matting.shift()
@@ -920,12 +920,12 @@ class PeachHTML5Editor
                        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
                        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) ->
                        n = n.parent
                        alpha *= 1.5
        pretty_html: (tree, indent = '', parent_flags = pre_ish: false, block: true, want_nl: false) ->