Skip to content

Instantly share code, notes, and snippets.

@mkeen
Created May 15, 2011 01:51
Show Gist options
  • Select an option

  • Save mkeen/972824 to your computer and use it in GitHub Desktop.

Select an option

Save mkeen/972824 to your computer and use it in GitHub Desktop.
class InterfaceWindow
constructor: ->
# Bind the basic events
$(window).mousemove (event) => this.mouseMoved(event.clientX, event.clientY)
mouseMoved: (x, y) ->
console.log(x + " " + y)
new InterfaceWindow
(function() {
var InterfaceWindow;
var __bind = function(fn, me){ return function(){ return fn.apply(me, arguments); }; };
InterfaceWindow = (function() {
function InterfaceWindow() {
$(window).mousemove(__bind(function(event) {
return this.mouseMoved(event.clientX, event.clientY);
}, this));
}
InterfaceWindow.prototype.mouseMoved = function(x, y) {
return console.log(x + " " + y);
};
return InterfaceWindow;
})();
new InterfaceWindow;
}).call(this);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment