Skip to content

Commit

Permalink
use the index to get the first page item
Browse files Browse the repository at this point in the history
  • Loading branch information
Geal committed Jun 4, 2012
1 parent dddf57c commit 7ecd2c7
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/app.js
Expand Up @@ -32,15 +32,21 @@

//helper.showSpinner('fetchPublicSpinner');

storage.getData('tutorial', 'text', function(error, data) {
if(!error && data != "null") {
d = JSON.parse(data);
$('#dataTitle').html(d.title);
$('#dataContent').html(d.content);
storage.getData('unpapered', 'index', function(error, data) {
if(error)
console.log(error)
else {
var index = JSON.parse(data)
var key = index[1]
storage.getData('unpapered', key, function(error, data) {
if(!error && data != "null") {
var d = JSON.parse(data);
$('#dataTitle').html(d.title);
$('#dataContent').html(d.content);
}
})
}

//helper.hideSpinner('fetchPublicSpinner');
});
})

return false;
});
Expand Down

0 comments on commit 7ecd2c7

Please sign in to comment.