};
function addObject(type, id, center) {
+ var hashParams = OSM.parseHash(window.location.hash);
map.addObject({ type: type, id: parseInt(id, 10) }, function (bounds) {
- if (!window.location.hash && bounds.isValid() &&
+ if (!hashParams.center && bounds.isValid() &&
(center || !map.getBounds().contains(bounds))) {
OSM.router.withoutMoveListener(function () {
map.fitBounds(bounds);
const changesetData = content.find("[data-changeset]").data("changeset");
changesetData.type = "changeset";
+ var hashParams = OSM.parseHash(window.location.hash);
initialize();
map.addObject(changesetData, function (bounds) {
- if (!window.location.hash && bounds.isValid()) {
+ if (!hashParams.center && bounds.isValid()) {
OSM.router.withoutMoveListener(function () {
map.fitBounds(bounds);
});
var data = $(".details").data();
if (!data) return;
var latLng = L.latLng(data.coordinates.split(","));
- if (!map.getBounds().contains(latLng)) moveToNote();
+ if (!map.getBounds().contains(latLng)) {
+ OSM.router.withoutMoveListener(function () {
+ map.setView(latLng, 15, { reset: true });
+ });
+ }
});
};
page.load = function (path, id) {
initialize(path, id);
- moveToNote();
};
function initialize(path, id) {
success: () => {
OSM.loadSidebarContent(path, () => {
initialize(path, id);
- moveToNote();
});
},
error: (xhr) => {
var data = $(".details").data();
if (data) {
+ var hashParams = OSM.parseHash(window.location.hash);
map.addObject({
type: "note",
id: parseInt(id, 10),
latLng: L.latLng(data.coordinates.split(",")),
icon: noteIcons[data.status]
+ }, function () {
+ if (!hashParams.center) {
+ var latLng = L.latLng(data.coordinates.split(","));
+ OSM.router.withoutMoveListener(function () {
+ map.setView(latLng, 15, { reset: true });
+ });
+ }
});
}
}
}
}
- function moveToNote() {
- var data = $(".details").data();
- if (!data) return;
- var latLng = L.latLng(data.coordinates.split(","));
-
- if (!window.location.hash || window.location.hash.match(/^#?c[0-9]+$/)) {
- OSM.router.withoutMoveListener(function () {
- map.setView(latLng, 15, { reset: true });
- });
- }
- }
-
page.unload = function () {
map.removeObject();
};
cK1+/2V+OkM/0nXjxPwPj7LiOediUyZNUn48r29uGOL1S83PSUdyST207CP6mZjc
K8aJmnGsVEAcWPzbpNh14q/c
-----END PRIVATE KEY-----
+# Override Firefox binary used in system tests
+#system_test_firefox_binary:
class ApplicationSystemTestCase < ActionDispatch::SystemTestCase
driven_by :selenium, :using => :headless_firefox do |options|
options.add_preference("intl.accept_languages", "en")
+ options.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary
end
def before_setup
# Capybara Webkit: https://github.com/jejacks0n/teaspoon/wiki/Using-Capybara-Webkit
require "selenium-webdriver"
config.driver = :selenium
+ firefox_options = Selenium::WebDriver::Firefox::Options.new(:args => ["-headless"])
+ firefox_options.binary = Settings.system_test_firefox_binary if Settings.system_test_firefox_binary
config.driver_options = {
:client_driver => :firefox,
:selenium_options => {
- :options => Selenium::WebDriver::Firefox::Options.new(:args => ["-headless"])
+ :options => firefox_options
}
}