aboutsummaryrefslogtreecommitdiff
path: root/js/io/system/coreioapi.js
diff options
context:
space:
mode:
authorJose Antonio Marquez2012-02-07 14:50:48 -0800
committerJose Antonio Marquez2012-02-07 14:50:48 -0800
commit516e04ab45ca1dbad9c2847a9a213919d6e812f5 (patch)
tree67e8ee7340c2ececfe98335fbaf47181bfa7ee16 /js/io/system/coreioapi.js
parent111509d5cbbd54b11afbc49f7c78d0c0548bb617 (diff)
downloadninja-516e04ab45ca1dbad9c2847a9a213919d6e812f5.tar.gz
Adding library synced events
Added an event that will be dispatched when Ninja loads and the local chrome Ninja library is fully synced with all required libs.
Diffstat (limited to 'js/io/system/coreioapi.js')
-rwxr-xr-xjs/io/system/coreioapi.js20
1 files changed, 17 insertions, 3 deletions
diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js
index 9836f33f..005eabf2 100755
--- a/js/io/system/coreioapi.js
+++ b/js/io/system/coreioapi.js
@@ -58,9 +58,9 @@ exports.CoreIoApi = Montage.create(Component, {
58 handleReady: { 58 handleReady: {
59 enumerable: false, 59 enumerable: false,
60 value: function (e) { 60 value: function (e) {
61 // 61 //Removing events
62 this.chromeFileSystem.removeEventListener('ready', this, false); 62 this.chromeFileSystem.removeEventListener('ready', this, false);
63 // 63 //Listening for library to be copied event (builds list)
64 this.chromeFileSystem.addEventListener('library', this, false); 64 this.chromeFileSystem.addEventListener('library', this, false);
65 } 65 }
66 }, 66 },
@@ -71,10 +71,24 @@ exports.CoreIoApi = Montage.create(Component, {
71 value: function (e) { 71 value: function (e) {
72 //Removing events 72 //Removing events
73 this.chromeFileSystem.removeEventListener('library', this, false); 73 this.chromeFileSystem.removeEventListener('library', this, false);
74 // 74 //Listening for synced library event
75 this.ninjaLibrary.addEventListener('sync', this, false);
76 //Sending library to be synced to chrome
75 this.ninjaLibrary.synchronize(e._event.ninjaChromeLibrary, this.chromeFileSystem); 77 this.ninjaLibrary.synchronize(e._event.ninjaChromeLibrary, this.chromeFileSystem);
78
76 } 79 }
77 }, 80 },
81 ////////////////////////////////////////////////////////////////////
82 //
83 handleSync: {
84 enumerable: false,
85 value: function (e) {
86 //Removing events
87 console.log('Ninja Local Library: Ready');
88 this.ninjaLibrary.removeEventListener('sync', this, false);
89 //TODO: Add sync loading screen logic
90 }
91 },
78 //////////////////////////////////////////////////////////////////// 92 ////////////////////////////////////////////////////////////////////
79 // 93 //
80 _chromeNinjaLibrary: { 94 _chromeNinjaLibrary: {