 
     scope.$on 'images_changed', ->
       _draw_images()
-      
-    glass.drag (e) ->
-      if scope.mode == 'lining' and _current_line?
-        _dragging = true
-
-
-    glass.mousedown (e) ->
-      if Touch? && (e instanceof Touch)
-        return
-      else
-        xy = _get_x_y e
-        if scope.mode == 'lining'
-          unless _current_line?
-            _start_line(xy.x, xy.y)
-
-    glass.mouseup (e) ->
-      _handle_click(e)
-
-    glass.mousemove (e) ->
-      _handle_mouse_move(e)
+
+    _setup_events = ->
+      glass.drag (e) ->
+        if scope.mode == 'lining' and _current_line?
+          _dragging = true
+
+      glass.mousedown (e) ->
+        if Touch? && (e instanceof Touch)
+          return
+        else
+          xy = _get_x_y e
+          if scope.mode == 'lining'
+            unless _current_line?
+              _start_line(xy.x, xy.y)
+
+      glass.mouseup (e) ->
+        _handle_click(e)
+
+      glass.mousemove (e) ->
+        _handle_mouse_move(e)
 
     ####### End Events ##################
 ]

      if scope.labels?
        scope.labels.remove()
        scope.labels.clear()
      if scope.settings.editing
        scope.circ.remove()

    ############## end local methods ############

    ############## Setup ########################

    element.find('.canvas').css
      width:  padding*2+width+'px'
      height: padding*2+height+'px'

    paper              = new Raphael(element.find('.canvas')[0], (padding*2)+width, (padding*2)+height)
    glass              = paper.rect(padding,padding,height,width).attr('stroke': 'none').attr('fill', 'white')
    scope.image_set    = paper.set()
    scope.points_lines = paper.set()

    _draw_background()

    ############## End Setup ####################

    ######### Events ####################

    scope.$watch 'settings.editing', ->
      # console.log 'settings.editing'

    gridSize = 25
    width  = parseInt attrs.width
    height = parseInt attrs.height
    scope.padding = padding = 4
    setup = false
    paper = null
    glass = null

    ######### End Attributes ########

