 
 SERVER = 'http://147.232.55.155:5000'
 
+isiPad = -> navigator.userAgent.match(/iPad/i) != null
+
 # TODO:
 # - Deselecting phrase by tapping somewhere else
 
 class App extends Spine.Controller
   events:
-    'click .phrase': 'select'
-    'touchend .phrase': 'select'
-    'click .image': 'open'
-    'touchend .image': 'open'
+    'tap .phrase': 'select'
+    'tap .image': 'open'
   
   constructor: ->
     super

      props.translateY = "#{distance}px"
    else if direction == 'bottom'
      props.translateY = "-#{distance}px"
    props.opacity = 0
    props.scale = 0.5
    item.gfx(props, {duration: 1})

    $("body").addClass("selected")
    
  _deselect: =>
    @_closeCurrent()
    $("body").removeClass("selected")
    phrases = @$(".phrase")
    # $(".hilight").detach()
    for phrase in phrases
      phrase = $(phrase)
      phrase.html(phrase.text())
