Commit 0ee6de96 authored by Petr Hošek's avatar Petr Hošek

229940 - schedule difference

parent 1c69a5f6
......@@ -126,21 +126,24 @@ end
`EASY.schedule.main` and `EASY.schedule.late` accepts priority as a second parameter. Lower the priority, later will be function executed.
`EASY.schedule.require` accepts function as a second parameter, which has to be fulfilled before the execution of the init function.
```javascript
/** EASY.schedule.late - For functions, which should be executed after several loops after "DOMContentLoaded" event */
EASY.schedule.late(function() {
// executed after EASY.sidebar.init();
EASY.sidebar.loadData();
}, -5);
/** EASY.schedule.main - for functions, which should be executed right after "DOMContentLoaded" event. */
EASY.schedule.main(function() {
EASY.sidebar.init();
});
```
```javascript
/** EASY.schedule.require usage */
/** EASY.schedule.require - For functions, which should wait for [prerequisite] fulfillment */
EASY.schedule.require(function(sidebar) {
sidebar.init();
},function() {
return window.EASY.sidebar;
});
/** Advanced usage */
EASY.schedule.require(function(counter, $) {
$("body").on("click", counter);
}, 'Counter', 'jQuery');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment