Skip to content
This repository was archived by the owner on Sep 19, 2018. It is now read-only.

Commit c16a3a0

Browse files
committed
append country code to past event link switcher
1 parent cc6b6b2 commit c16a3a0

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

static/js/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ var Codeweek = window.Codeweek || {};
1313
placeinfowindow = null,
1414
overlapSpiderifier = null;
1515

16-
1716
function createMap(events, lat, lng, zoomVal) {
1817
var markerData = JSON.parse(events),
1918
markerData_len = markerData.length,
@@ -212,6 +211,7 @@ var Codeweek = window.Codeweek || {};
212211
$('#country').html(country_name);
213212
}
214213

214+
215215
function initialize(events, lon, lan) {
216216
map = createMap(events, lon, lan, 3);
217217
//setAutocomplete();
@@ -250,6 +250,12 @@ var Codeweek = window.Codeweek || {};
250250
document.location.hash = "!" + country_code;
251251
});
252252

253+
$("#past-link").click(function (event) {
254+
255+
var newUrl = $(this).attr('href') + document.location.hash;
256+
$(this).attr('href', newUrl);
257+
});
258+
253259
$("#zoomEU").click(function (event) {
254260
event.preventDefault();
255261

web/templates/pages/index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131
<div class="container index-content">
3232
<div id="past-events">
3333
{% if past == 'yes' %}
34-
<a href="{% url 'web.index' %}"><i class="fa fa-check-square-o"></i>
34+
<a id="past-link" href="{% url 'web.index' %}"><i class="fa fa-check-square-o"></i>
3535
{% else %}
36-
<a href="{% url 'web.index' %}?past=yes"><i class="fa fa-square-o"></i>
36+
<a id="past-link" href="{% url 'web.index' %}?past=yes"><i class="fa fa-square-o"></i>
3737
{% endif %}
3838
Show past events</a>
3939
</div>

0 commit comments

Comments
 (0)