From 295d72960cad391850803e8c4e83d5133bbe82f7 Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Mon, 6 Feb 2012 11:40:15 -0800 Subject: Setting up library detection for Chrome File System --- js/io/system/coreioapi.js | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'js/io/system/coreioapi.js') diff --git a/js/io/system/coreioapi.js b/js/io/system/coreioapi.js index 3fb9374a..3be6011d 100755 --- a/js/io/system/coreioapi.js +++ b/js/io/system/coreioapi.js @@ -55,8 +55,25 @@ exports.CoreIoApi = Montage.create(Component, { handleReady: { enumerable: false, value: function (e) { + // this.chromeFileSystem.removeEventListener('ready', this, false); - this.chromeNinjaLibrary = this.chromeFileSystem.getLocalLibrary(); + // + this.chromeFileSystem.addEventListener('library', this, false); + } + }, + //////////////////////////////////////////////////////////////////// + // + handleLibrary: { + enumerable: false, + value: function (e) { + // + this.chromeFileSystem.removeEventListener('library', this, false); + // + if (e._event.ninjaChromeLibrary.length < 1) { + console.log('no libraries'); + } else { + console.log('found libraries'); + } } }, //////////////////////////////////////////////////////////////////// -- cgit v1.2.3