From e5d6c34efb749b592d06013aa47f0b3a29482bd0 Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 8 Jan 2015 22:56:39 -0500 Subject: [PATCH] No default OK button on iD.ui.confirm This allows the calling code to either keep the OK button or to override with other buttons as needed. --- js/id/ui/confirm.js | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/js/id/ui/confirm.js b/js/id/ui/confirm.js index d70612b87..6ce9b71ee 100644 --- a/js/id/ui/confirm.js +++ b/js/id/ui/confirm.js @@ -15,12 +15,17 @@ iD.ui.confirm = function(selection) { var buttonwrap = section.append('div') .attr('class', 'modal-section buttons cf'); - buttonwrap.append('button') - .attr('class', 'col2 action') - .on('click.confirm', function() { - modal.remove(); - }) - .text(t('confirm.okay')); + modal.okButton = function() { + buttonwrap + .append('button') + .attr('class', 'col2 action') + .on('click.confirm', function() { + modal.remove(); + }) + .text(t('confirm.okay')); + + return modal; + }; return modal; };