mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-16 18:52:57 +00:00
Fix default background opacity
This commit is contained in:
13
js/id/id.js
13
js/id/id.js
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user