Fix default background opacity

This commit is contained in:
John Firebaugh
2013-08-17 12:52:40 -07:00
parent 40bba4684c
commit 22cee50788
2 changed files with 9 additions and 6 deletions

View File

@@ -8,11 +8,14 @@ window.iD = function () {
// https://github.com/systemed/iD/issues/772
// http://mathiasbynens.be/notes/localstorage-pattern#comment-9
try { storage = localStorage; } catch (e) {}
storage = storage || {
getItem: function() {},
setItem: function() {},
removeItem: function() {}
};
storage = storage || (function() {
var s = {};
return {
getItem: function(k) { return s[k]; },
setItem: function(k, v) { s[k] = v; },
removeItem: function(k) { delete s[k] }
};
})();
context.storage = function(k, v) {
if (arguments.length === 1) return storage.getItem(k);

View File

@@ -6,7 +6,7 @@ iD.ui.Background = function(context) {
['top', [0, -1]],
['right', [-1, 0]],
['bottom', [0, 1]]],
opacityDefault = (context.storage('background-opacity') !== undefined) ?
opacityDefault = (context.storage('background-opacity') != undefined) ?
(+context.storage('background-opacity')) : 0.5;
function background(selection) {