Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Started work on how Ember manages future work.
- Loading branch information
Showing
11 changed files
with
48,693 additions
and
35 deletions.
There are no files selected for viewing
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
Ember.Application.initializer({ | ||
name: 'Stop listening for overly noisy mouse events', | ||
|
||
initialize: function(container, application) { | ||
var events = container.lookup('event_dispatcher:main').events; | ||
delete events.mousemove; | ||
delete events.mouseenter; | ||
delete events.mouseleave; | ||
} | ||
}); | ||
|
||
|
||
$(document).ready(function () { | ||
$('body').on('click', '.foo', function (evt) { | ||
console.log('hi from raw event'); | ||
}); | ||
}); | ||
|
||
// Start of demo Ember app | ||
// *********************** | ||
|
||
window.Todos = Ember.Application.create({ | ||
ready: function () { | ||
Ember.debug('putting stuff on next runloop'); | ||
Ember.run.next(function () { | ||
console.log('hi'); | ||
}); | ||
Ember.run.next(function () { | ||
console.log('hi again'); | ||
}); | ||
// Ember.run(function () { | ||
// Ember.debug('In my own runloop'); | ||
// $('body').css('background-color', 'pink'); | ||
// Ember.run(function () { | ||
// Ember.debug('In a nested runloop'); | ||
// $('body').css('background-color', 'red'); | ||
// }); | ||
// }); | ||
// Ember.run(function () { | ||
// Ember.debug('In another of my own runloops'); | ||
// $('body').css('background-color', 'yellow'); | ||
// }); | ||
} | ||
}); | ||
|
||
Todos.Router.map(function() { | ||
this.resource('todos', { path: '/' }); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"name": "noisy-runloop", | ||
"version": "0.0.0", | ||
"homepage": "https://github.com/eoinkelly/ember-runloop-handbook", | ||
"authors": [ | ||
"Eoin Kelly <eoin@rabidtech.co.nz>" | ||
], | ||
"license": "MIT", | ||
"private": true, | ||
"dependencies": { | ||
"ember": "~1.7.0" | ||
} | ||
} |
Oops, something went wrong.