From b9b2c6a0138893e7829ccea8f5270f13bfd1cf15 Mon Sep 17 00:00:00 2001 From: Joe Bowser Date: Mon, 23 Jul 2012 10:43:23 -0700 Subject: [PATCH] Updating sample project --- bin/templates/project/assets/www/index.html | 4 ++-- bin/templates/project/assets/www/js/index.js | 11 ++++++++--- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/bin/templates/project/assets/www/index.html b/bin/templates/project/assets/www/index.html index f5cf6213..fc9dd1d2 100644 --- a/bin/templates/project/assets/www/index.html +++ b/bin/templates/project/assets/www/index.html @@ -2,14 +2,14 @@ - + Hello Cordova
-

Apache Cordova™

+

Apache Cordova

diff --git a/bin/templates/project/assets/www/js/index.js b/bin/templates/project/assets/www/js/index.js index f3894b8a..61403310 100644 --- a/bin/templates/project/assets/www/js/index.js +++ b/bin/templates/project/assets/www/js/index.js @@ -6,10 +6,15 @@ var app = { document.addEventListener('deviceready', this.deviceready, false); }, deviceready: function() { + // note that this is an event handler so the scope is that of the event + // so we need to call app.report(), and not this.report() app.report('deviceready'); }, - report: function(id) { - document.querySelector('#' + id + ' .pending').classList.add('hide'); - document.querySelector('#' + id + ' .complete').classList.remove('hide'); + report: function(id) { + console.log("report:" + id); + // hide the .pending

and show the .complete

+ document.querySelector('#' + id + ' .pending').className += ' hide'; + var completeElem = document.querySelector('#' + id + ' .complete'); + completeElem.className = completeElem.className.split('hide').join(''); } };