Skip to content

Commit

Permalink
updated logic for adding a new meme to homepage now that memes are so…
Browse files Browse the repository at this point in the history
…rted in reverse order
  • Loading branch information
fab committed May 12, 2013
1 parent d76d41e commit a8b1b90
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions public/js/application.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ function openFilePicker() {
services:['COMPUTER', 'FACEBOOK', 'GMAIL', 'INSTAGRAM']
},
function(FPFile){
var tempID = allTheMemes[allTheMemes.length - 1].id + 1;
var tempID = allTheMemes[0].id + 1;
var meme = new Meme (tempID, FPFile.url);
allTheMemes.push(meme);
$.post('upload', meme);
var memeDiv = ['<div id="', tempID,'" class="meme">', meme.smallImg,'</div>'].join('');
$('#display-all-memes').append(memeDiv);
$('#display-all-memes').prepend(memeDiv);
},
function(FPError){
console.log(FPError.toString());
Expand Down

0 comments on commit a8b1b90

Please sign in to comment.