Skip to content

Commit

Permalink
Maintain previous selection when returning to the page
Browse files Browse the repository at this point in the history
  • Loading branch information
jacebrowning committed Apr 2, 2016
1 parent 5a99d68 commit f22079d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion memegen/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,11 @@ <h2>The open source meme generator.</h2>
generateMeme();
});

$( ".js-meme-selector" ).val("{{ default_template }}").trigger("change");
if ($('#meme-text-top').val() || $('#meme-text-bottom').val()) {
$(".js-meme-selector").trigger("change");
} else {
$(".js-meme-selector").val("{{ default_template }}").trigger("change");;
}
</script>

<script>
Expand Down

0 comments on commit f22079d

Please sign in to comment.