X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/99072156506b954fcb1dc7a2ab075bb3e9299122..7c47cde474690f3d94f286b3477a1a31a1c51420:/app/assets/javascripts/application.js diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 20976d15a..29563cb4a 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -1,6 +1,5 @@ //= require jquery3 //= require jquery_ujs -//= require jquery.timers //= require jquery.throttle-debounce //= require js-cookie/dist/js.cookie //= require popper @@ -17,6 +16,29 @@ //= require richtext //= require qs/dist/qs +{ + const application_data = $("head").data(); + + I18n.default_locale = OSM.DEFAULT_LOCALE; + I18n.locale = application_data.locale; + I18n.fallbacks = true; + + OSM.preferred_editor = application_data.preferredEditor; + OSM.preferred_languages = application_data.preferredLanguages; + + if (application_data.user) { + OSM.user = application_data.user; + + if (application_data.userHome) { + OSM.home = application_data.userHome; + } + } + + if (application_data.location) { + OSM.location = application_data.location; + } +} + /* * Called as the user scrolls/zooms around to manipulate hrefs of the * view tab and various other links @@ -106,6 +128,7 @@ $(document).ready(function () { $("body").removeClass("compact-nav"); $("header").removeClass("text-nowrap"); + $("header nav.secondary > ul").removeClass("flex-nowrap"); updateHeader(); @@ -122,27 +145,6 @@ $(document).ready(function () { $("header").toggleClass("closed"); }); - var application_data = $("head").data(); - - I18n.default_locale = OSM.DEFAULT_LOCALE; - I18n.locale = application_data.locale; - I18n.fallbacks = true; - - OSM.preferred_editor = application_data.preferredEditor; - OSM.preferred_languages = application_data.preferredLanguages; - - if (application_data.user) { - OSM.user = application_data.user; - - if (application_data.userHome) { - OSM.home = application_data.userHome; - } - } - - if (application_data.location) { - OSM.location = application_data.location; - } - $("#edit_tab") .attr("title", I18n.t("javascripts.site.edit_disabled_tooltip")); });