From ca017090cb900a868b388888c32f4281b82d4615 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 24 Jan 2013 17:09:38 -0500 Subject: [PATCH] Save commit messages between saves. Fixes #454 --- js/id/ui/commit.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/js/id/ui/commit.js b/js/id/ui/commit.js index d58e9ca3d..d85041992 100644 --- a/js/id/ui/commit.js +++ b/js/id/ui/commit.js @@ -62,7 +62,8 @@ iD.ui.commit = function(map) { var comment_section = body.append('div').attr('class','modal-section fillD'); comment_section.append('textarea') .attr('class', 'changeset-comment') - .attr('placeholder', 'Brief Description of your contributions'); + .attr('placeholder', 'Brief Description of your contributions') + .property('value', localStorage.comment || ''); // Confirm / Cancel Buttons var buttonwrap = comment_section.append('div') @@ -74,8 +75,10 @@ iD.ui.commit = function(map) { .append('button') .attr('class', 'save action col6 button') .on('click.save', function() { + var comment = d3.select('textarea.changeset-comment').node().value; + localStorage.comment = comment; event.save({ - comment: d3.select('textarea.changeset-comment').node().value + comment: comment }); }); savebutton.append('span').attr('class','label').text('Save');