/* * Copyright 2020 Netsyms Technologies. * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ function setTabSwipable() { var page = $(".page[data-name=discover]"); // If the page has grown larger, refresh to disable swiping tabs if (page.width() >= 768 && $(".tabs-swipeable-wrap")[0]) { router.refreshPage(); } else if (page.width() < 768 && !$(".tabs-swipeable-wrap")[0]) { router.refreshPage(); } } $(window).on('resize', setTabSwipable); setTabSwipable(); // Adjust the map when opening its tab $(".view-main").on("click", ".tab-link#map-tab-link", function () { var center = map.getCenter(); map.resize(); map.setCenter(center); });