Skip to content

Instantly share code, notes, and snippets.

@dwilkins
Created April 28, 2013 16:03
Show Gist options
  • Save dwilkins/5477339 to your computer and use it in GitHub Desktop.
Save dwilkins/5477339 to your computer and use it in GitHub Desktop.
Trouble using microevent.js with virtualjoystick.js
#crawler-js-container
#crawler-js
:coffeescript
window.joystick = {};
($ document).ready ->
MicroEvent.mixin VirtualJoystick
window.joystick = new VirtualJoystick({
container : document.getElementById('crawler-js-container'),
mouseSupport : true
})
window.joystick.bind '_onMove', ->
console.log 'notified date', date
= javascript_include_tag "virtualjoystick/virtualjoystick.js"
= javascript_include_tag "microevents/microevent-debug.js"
@dwilkins
Copy link
Author

Generated Javascript

  (function() {
    window.joystick = {};

    ($(document)).ready(function() {
      MicroEvent.mixin(VirtualJoystick);
      window.joystick = new VirtualJoystick({
        container: document.getElementById('crawler-js-container'),
        mouseSupport: true
      });
      return window.joystick.bind('_onMove', function() {
        return console.log('notified date', date);
      });
    });

  }).call(this);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment