diff --git a/css/app.css b/css/app.css index a7931a2da..67d0e7f0c 100644 --- a/css/app.css +++ b/css/app.css @@ -1879,7 +1879,8 @@ div.full-screen > button:hover { background-color: #ececec; } -.layer-list li.active { +.layer-list li.active, +.layer-list li.switch { background: #E8EBFF; } @@ -1895,10 +1896,6 @@ div.full-screen > button:hover { max-width: 160px; } -.layer-list li.switch { - background: #fffce8; -} - .layer-list label { display: block; padding: 5px 10px; diff --git a/data/core.yaml b/data/core.yaml index e6c6bb5b4..7af8cba01 100644 --- a/data/core.yaml +++ b/data/core.yaml @@ -274,6 +274,7 @@ en: percent_brightness: "{opacity}% brightness" none: None best_imagery: Best known imagery source for this location + switch: Switch back to this background custom: Custom custom_button: Edit custom background custom_prompt: "Enter a tile URL template. Valid tokens are {z}, {x}, {y} for Z/X/Y scheme and {u} for quadtile scheme." diff --git a/dist/locales/en.json b/dist/locales/en.json index 3605332e3..9adfa707b 100644 --- a/dist/locales/en.json +++ b/dist/locales/en.json @@ -330,6 +330,7 @@ "percent_brightness": "{opacity}% brightness", "none": "None", "best_imagery": "Best known imagery source for this location", + "switch": "Switch back to this background", "custom": "Custom", "custom_button": "Edit custom background", "custom_prompt": "Enter a tile URL template. Valid tokens are {z}, {x}, {y} for Z/X/Y scheme and {u} for quadtile scheme.", diff --git a/js/id/ui/background.js b/js/id/ui/background.js index abf846801..015642ec8 100644 --- a/js/id/ui/background.js +++ b/js/id/ui/background.js @@ -9,7 +9,7 @@ iD.ui.Background = function(context) { opacityDefault = (context.storage('background-opacity') !== null) ? (+context.storage('background-opacity')) : 1.0, customTemplate = context.storage('background-custom-template') || '', - latestBg = [context.background().baseLayerSource(), null]; + previous; // Can be 0 from <1.3.0 use or due to issue #1923. if (opacityDefault === 0) opacityDefault = 1.0; @@ -39,29 +39,48 @@ iD.ui.Background = function(context) { context.storage('background-opacity', d); } + function setTooltips(selection) { + selection.each(function(d) { + var item = d3.select(this); + if (d === previous) { + item.call(bootstrap.tooltip() + .html(true) + .title(function() { + var tip = '