 #= require ../services/session
 
 module = angular.module("plunker.userpanel", ["plunker.session"])
+
+module.directive "plnkrPress", ["$parse", ($parse) ->
+  (scope, element, attrs) ->
+    tapping = false
+    fn = $parse(attrs["plnkrPress"])
+    
+    element.bind 'touchstart', (e) -> tapping = true
+    element.bind 'touchmove', (e) -> tapping = false
+    element.bind 'touchend', (e) -> if tapping then scope.$apply -> fn(scope, $event: e)
+    element.bind 'click', (e) -> scope.$apply -> fn(scope, $event: e)
+]
 
 module.directive "userpanel", [ ->
   restrict: "E"

        </button>
        <ul class="dropdown-menu">
          <li>
            <a class="login login-github" data-service="github" href="javascript:void(0)" ng-click="session.login()">
              <i class="icon-github" />
              Sign in with Github
            </a>

          </li>
          <li class="divider"></li>
          <li>
            <a class="logout" href="javascript:void(0)" plnkr-press="session.logout()">Logout</a>
          </li>
        </ul>
      </div>
