Skip to content

Commit

Permalink
Ingore onhashchange-event triggered by nextCite()
Browse files Browse the repository at this point in the history
  • Loading branch information
codedust committed May 14, 2019
1 parent 8805450 commit cb40f9a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions static/app.js
@@ -1,10 +1,9 @@
var current_quote = {};
var nextCiteTimeout = null;
var current_hash = '';

function nextCite(hash){
if (nextCiteTimeout != null) {
window.clearTimeout(nextCiteTimeout);
nextCiteTimeout = null;
if (hash == current_hash) {
return;
}
$('.partybutton').removeClass('correct');
$('.partybutton').removeClass('wrong');
Expand All @@ -27,6 +26,7 @@ function nextCite(hash){
$('q').text(data.short);
if (data.line_number != '' && data.sentence_number != '' && data.party != '') {
location.hash = btoa(data.line_number + ',' + data.sentence_number + ',' + data.party);
current_hash = location.hash;
}
var url = location.href;
var text = "Aus welchem Wahlprogramm stammt dieses Zitat? #Wahlprogrammquiz #Europawahl2019\n\n";
Expand Down

0 comments on commit cb40f9a

Please sign in to comment.