Save custom background to localstorage (closes #2566)

This commit is contained in:
Bryan Housel
2015-03-31 20:11:41 -04:00
parent 42efb9a475
commit f8bd67c169

View File

@@ -8,7 +8,7 @@ iD.ui.Background = function(context) {
['bottom', [0, 1]]],
opacityDefault = (context.storage('background-opacity') !== null) ?
(+context.storage('background-opacity')) : 0.5,
customTemplate = '';
customTemplate = context.storage('background-custom-template') || '';
// Can be 0 from <1.3.0 use or due to issue #1923.
if (opacityDefault === 0) opacityDefault = 0.5;
@@ -64,6 +64,7 @@ iD.ui.Background = function(context) {
function setCustom(template) {
context.background().baseLayerSource(iD.BackgroundSource.Custom(template));
selectLayer();
context.storage('background-custom-template', template);
}
function clickSetOverlay(d) {