diff --git a/css/app.css b/css/app.css index 4ece851ee..db694813f 100644 --- a/css/app.css +++ b/css/app.css @@ -248,6 +248,12 @@ button small { box-shadow:0 0 5px #000; } +.modal.loading-pane { + width:300px; + height:200px; + margin-left:-160px; +} + .shaded:before { content:''; background:rgba(0,0,0,0.5); diff --git a/index.html b/index.html index b14274186..b8304e9c5 100644 --- a/index.html +++ b/index.html @@ -26,6 +26,7 @@ + diff --git a/js/iD/id.js b/js/iD/id.js index d4e457824..d2cfba300 100644 --- a/js/iD/id.js +++ b/js/iD/id.js @@ -68,13 +68,15 @@ var iD = function(container) { .attr('class', 'save') .html("Save") .on('click', function() { - function save() { + function save(e) { + d3.select('.shaded').remove(); + var l = iD.loading('committing changes to openstreetmap'); connection.putChangeset(map.history.changes(), e.comment, function() { - shaded.remove(); + l.remove(); }); } connection.authenticate(function() { - var shaded = d3.select(document.body) + shaded = d3.select(document.body) .append('div').attr('class', 'shaded') .on('click', function() { if (d3.event.target == this) shaded.remove(); diff --git a/js/iD/ui/Inspector.js b/js/iD/ui/Inspector.js index 8291409d4..9cbdf3d5f 100644 --- a/js/iD/ui/Inspector.js +++ b/js/iD/ui/Inspector.js @@ -102,7 +102,7 @@ iD.Inspector = function() { selection.append('button') .attr('class', 'save').text('Save') .on('click', function() { - event.changeTags(entity, newtags(table)); + event.changeTags(entity, update()); }); selection.append('button') @@ -113,26 +113,6 @@ iD.Inspector = function() { }); } - // TODO: there must be a function for this - function unentries(x) { - var obj = {}; - for (var i = 0; i < x.length; i++) { - if (obj[x[i].key] && x[i].value) obj[x[i].key] = x[i].value; - } - return obj; - } - - function formtags(table) { - var t = newtags(table); - if (Object.keys(t).indexOf('') === -1) t[''] = ''; - return d3.entries(t); - } - - function newtags(table) { - var inputs = table.selectAll('input.tag-value') - .data(); - return unentries(inputs); - } return d3.rebind(inspector, event, 'on'); };