 
 
   _onTouchLeave: (e, cube) ->
-    return unless @_touchStarted
-    @_onTouchEnd e, cube if e.toElement and not cube.el.contains e.toElement
+    return unless cube.touchStarted
+    @_onTouchEnd e, cube
+
+
+  _onMouseOut: (e, cube) =>
+    return unless cube.touchStarted
+    @_onTouchEnd e, cube if e.toElement and !cube.el.contains e.toElement
 
 
   setValue: (settings) ->

      cube.el.appendChild cube[side]

    eventPairs = [['TouchStart', 'MouseDown'], ['TouchMove', 'MouseMove'],
      ['TouchEnd', 'MouseUp'], ['TouchLeave', 'MouseOut']]

    for eventPair in eventPairs
      for eString in eventPair then do (fn = '_on' + eventPair[0], cube) =>
        cube.el.addEventListener eString.toLowerCase(), (e) =>
          @[fn] e, cube
        , true

    @_setSides cube
    cube


  _onTouchStart: (e, cube) ->
    e.preventDefault()
    cube.touchStarted = true
    e.currentTarget.classList.add 'no-tween'
    if e.type is 'mousedown'
      cube.y1 = e.pageY
