 
   goToPage: (targetPanel,options) ->
 
-    if options.back
-      @back = options.back
+    if options?
+      if options.back
+        @back = options.back
 
     @targetPanel = document.querySelector(targetPanel)
     transtionType = @currentPanel.getAttribute("data-transition")


#backBtn.addEventListener 'touchstart', ->
#  flight.slideTransition('#panel-1','#panel-2','0.4s',true)
$('.back').click (e) =>
    flight.goToPage('#panel-1')

$('.forward').click (e) =>
  flight.goToPage('#panel-2',{back:true})


#if 'ontouchstart' in window


      @targetPanel.style.webkitTransition = "#{@speed} ease"
      @targetPanel.style.webkitTransform = "translateX(100%)"
      @currentPanel.addEventListener("webkitTransitionEnd", =>
        @finishTransition()
      , false);
