From bd57b81192c9e3c5dbd1ac749b5d7bcc975cf8be Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 7 Apr 2016 00:53:32 -0400 Subject: [PATCH] Improve usability of Save, Cancel buttons (closes #3040) --- css/app.css | 3 ++- js/id/ui/commit.js | 16 ++++++++-------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/css/app.css b/css/app.css index c29f6429b..101238d16 100644 --- a/css/app.css +++ b/css/app.css @@ -2429,7 +2429,8 @@ div.full-screen > button:hover { vertical-align: middle; } -.save-section .buttons .action { +.save-section .buttons .action, +.save-section .buttons .secondary-action { display: inline-block; margin: 0 20px 0 0; text-align: center; diff --git a/js/id/ui/commit.js b/js/id/ui/commit.js index 645fc8751..b5691ff88 100644 --- a/js/id/ui/commit.js +++ b/js/id/ui/commit.js @@ -151,6 +151,14 @@ iD.ui.Commit = function(context) { var buttonSection = saveSection.append('div') .attr('class','buttons fillL cf'); + var cancelButton = buttonSection.append('button') + .attr('class', 'secondary-action col5 button cancel-button') + .on('click.cancel', function() { dispatch.cancel(); }); + + cancelButton.append('span') + .attr('class', 'label') + .text(t('commit.cancel')); + var saveButton = buttonSection.append('button') .attr('class', 'action col5 button save-button') .attr('disabled', function() { @@ -167,14 +175,6 @@ iD.ui.Commit = function(context) { .attr('class', 'label') .text(t('commit.save')); - var cancelButton = buttonSection.append('button') - .attr('class', 'action col5 button cancel-button') - .on('click.cancel', function() { dispatch.cancel(); }); - - cancelButton.append('span') - .attr('class', 'label') - .text(t('commit.cancel')); - // Changes var changeSection = body.selectAll('div.commit-section')