3 //= require jquery.timers
4 //= require jquery.cookie
5 //= require jquery.throttle-debounce
6 //= require bootstrap.tooltip
7 //= require bootstrap.dropdown
11 //= require leaflet.osm
12 //= require leaflet.map
13 //= require leaflet.zoom
14 //= require leaflet.locationfilter
15 //= require i18n/translations
19 //= require querystring
21 var querystring = require('querystring-component');
24 * Called as the user scrolls/zooms around to maniplate hrefs of the
25 * view tab and various other links
27 function updateLinks(loc, zoom, layers, object) {
28 $(".geolink").each(function(index, link) {
29 var href = link.href.split(/[?#]/)[0],
30 args = querystring.parse(link.search.substring(1)),
31 editlink = $(link).hasClass("editlink");
36 delete args.changeset;
38 if (object && editlink) {
39 args[object.type] = object.id;
42 var query = querystring.stringify(args);
43 if (query) href += '?' + query;
47 lon: 'lon' in loc ? loc.lon : loc.lng,
51 if (layers && !editlink) {
55 href += OSM.formatHash(args);
60 var editDisabled = zoom < 13;
62 .tooltip({placement: 'bottom'})
64 .on('click.minzoom', function() { return !editDisabled; })
65 .toggleClass('disabled', editDisabled)
66 .attr('data-original-title', editDisabled ?
67 I18n.t('javascripts.site.edit_disabled_tooltip') : '');
70 function maximiseMap() {
71 $("#content").addClass("maximised");
74 function minimiseMap() {
75 $("#content").removeClass("maximised");
78 $(document).ready(function () {
79 $("#menu-icon").on("click", function(e) {
81 $("header").toggleClass("closed");
84 $("nav.primary li a").on("click", function() {
85 $("header").toggleClass("closed");