MediaWiki:Mobile.js: Difference between revisions

From OpenStreetMap Wiki
Jump to navigation Jump to search
(If Template:Languages is transcluded multiple times on a page, “Other languages” should toggle all the language bars, not just the first one)
 
Line 3: Line 3:
// adds expansion link for language bars
// adds expansion link for language bars
$(document).ready(function() {
$(document).ready(function() {
$('#ExpandLanguages a:first-child').click(function(event) {
$('#ExpandLanguages li:first-child a').click(function(event) {
event.preventDefault();
event.preventDefault();
$('.LanguageBar').toggleClass('showOther');
$('.LanguageBar').toggleClass('showOther');

Latest revision as of 01:14, 14 October 2019

/* Any JavaScript here will be loaded for users using the mobile site */

// adds expansion link for language bars
$(document).ready(function() {
    $('#ExpandLanguages li:first-child a').click(function(event) {
        event.preventDefault();
        $('.LanguageBar').toggleClass('showOther');
        // The text of the link might need to change as well
    });
});

// code from joto to produce taglist tables, doing calls to get data from taginfo
// Used for creating lists of tags from taginfo.
// See https://wiki.openstreetmap.org/wiki/Taginfo/Taglists
jQuery.getScript( "https://taginfo.openstreetmap.org/js/taglists.js", function() {
  $(document).ready(function() {
    taginfo_taglist.convert_to_taglist('.taglist');
  });
});