PageRenderTime 47ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/documentation/af.ui/$.ui.ready.md

https://github.com/jaydenlin/appframework
Markdown | 46 lines | 29 code | 17 blank | 0 comment | 0 complexity | 55c3118521687c71ffa47bbbf265a563 MD5 | raw file
  1. #$.ui.ready
  2. ```
  3. function to fire when afui is ready and completed launch
  4. ```
  5. ##Example
  6. ```
  7. $.ui.ready(function(){console.log('afui is ready');});
  8. ```
  9. ##Parameters
  10. ```
  11. function Function
  12. ```
  13. ##Returns
  14. ```
  15. undefined
  16. ```
  17. ##Detail
  18. $.ui.ready - this is similar to $(document).ready but fires after App Framework UI has launched.
  19. If you use data-defer to load content, this launches AFTER all data-defer files are loaded.
  20. If the event has already dispatched and you create a $.ui.ready function, it will execute right away.
  21. ```
  22. $.ui.ready(function(){
  23. //App is ready lets check if a user exists.
  24. if(user===false)
  25. return $.ui.loadContent("#login");
  26. else
  27. return $.ui.loadContent("#main");
  28. });
  29. ```