diff --git a/examples/tetris/index.html b/examples/tetris/index.html index d418bee..6d9cf3f 100644 --- a/examples/tetris/index.html +++ b/examples/tetris/index.html @@ -73,11 +73,7 @@

NaCl Tetris

diff --git a/nacl/js/aroma.coffee b/nacl/js/aroma.coffee index c24aa19..3655288 100644 --- a/nacl/js/aroma.coffee +++ b/nacl/js/aroma.coffee @@ -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" diff --git a/site/js_reference.moon b/site/js_reference.moon index 7ecaf18..9ba5525 100644 --- a/site/js_reference.moon +++ b/site/js_reference.moon @@ -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: [[