      1 pockets.ui.BaseSceneAssistant = Class.create({
      2   initialize: function() {
      3     this.menuManager = new pockets.managers.MenuManager(this);
      4     this.eventManager = new pockets.managers.EventManager(this);
      5   },
      6
      7   setup: function() {
      8     if (pockets.nestedPropertyExists(this, 'controller.stageController.assistant.setupMenus')) {
      9       this.controller.stageController.assistant.setupMenus(this.menuManager.models);
     10     }
     11
     12     if (pockets.nestedPropertyExists(this, 'setupMenus')) {
     13       this.setupMenus(this.menuManager.models);
     14     }
     15
     16     this.menuManager.refreshAllMenus();
     17   },
     18
     19   activate: function() {
     20     this.eventManager.startAllListening();
     21   },
     22
     23   deactivate: function() {
     24     this.eventManager.stopAllListening();
     25   },
     26
     27   cleanup: function() {
     28     this.eventManager.cleanup();
     29   }
     30 });
     31