Guest User

Untitled

a guest
Jul 17th, 2018
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. document.observe("dom:loaded", function() {
  2. var test = new a;
  3. });
  4.  
  5. /* javascript file #1 */
  6. var a = (function() {
  7.  
  8. var a = Class.create({
  9.  
  10. initialize: function() {
  11. new b(this.future_func);
  12. },
  13.  
  14. do_something: function() {
  15. console.log('it has been done!');
  16. },
  17.  
  18. do_another_thing: function() {
  19. console.log('another thing!');
  20. },
  21.  
  22. future_func: function() {
  23. var my_a = this;
  24. my_a.do_another_thing();
  25.  
  26. var later_func = function() {
  27. my_a.do_something();
  28. }
  29.  
  30. return later_func;
  31. }
  32. });
  33.  
  34. return a;
  35.  
  36. })();
  37.  
  38. /* javascript file #2 */
  39.  
  40. var b = (function() {
  41.  
  42. var b = Class.create({
  43.  
  44. initialize: function(func) {
  45. func();
  46. }
  47. });
  48.  
  49. return b;
  50.  
  51. })();
Add Comment
Please, Sign In to add comment