Skip to content

Commit

Permalink
fix broken default loader
Browse files Browse the repository at this point in the history
  • Loading branch information
leafo committed May 14, 2012
1 parent 9ca27a7 commit c211a81
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
6 changes: 1 addition & 5 deletions examples/tetris/index.html
Expand Up @@ -73,11 +73,7 @@ <h1>NaCl Tetris</h1>

<script type="text/javascript">
(function() {
var game = new Aroma("game", 300, 400, {
loaded: function() {
game.execute("require 'main' aroma.load()");
}
});
var game = new Aroma("game", 300, 400);
})();
</script>
</body>
Expand Down
5 changes: 3 additions & 2 deletions nacl/js/aroma.coffee
Expand Up @@ -195,9 +195,10 @@ class Aroma
@events.loaded = @events.loaded || =>
@execute """
require "main"
aroma.load and aroma.load()
if aroma and aroma.load then
aroma.load()
end
"""

listen @listener, "load", =>
log "Loaded module"
@module = @listener.querySelector "embed"
Expand Down
9 changes: 9 additions & 0 deletions site/js_reference.moon
Expand Up @@ -97,6 +97,15 @@ package {
By default, `std_out` is set to write to `console.log` and `std_err` is
set to write to `console.err`.
The default loaded event executes the following Lua code:
```lua
require "main"
if aroma and aroma.load then
aroma.load()
end
```
]]

code: [[
Expand Down

0 comments on commit c211a81

Please sign in to comment.