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(''); } };