From bf0da89925c8a918434491cdde7961f8f9f0fe9e Mon Sep 17 00:00:00 2001 From: Aaron Lidman Date: Tue, 19 Nov 2013 12:04:12 -0800 Subject: [PATCH] Improved warning visibility for #1973 --- js/id/ui/commit.js | 58 ++++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 28 deletions(-) diff --git a/js/id/ui/commit.js b/js/id/ui/commit.js index 6adc9511f..80f043319 100644 --- a/js/id/ui/commit.js +++ b/js/id/ui/commit.js @@ -48,6 +48,36 @@ iD.ui.Commit = function(context) { commentField.node().select(); + // Warnings + var warnings = body.selectAll('div.warning-section') + .data([iD.validate(changes, context.graph())]) + .enter() + .append('div') + .attr('class', 'modal-section warning-section fillL2') + .style('display', function(d) { return _.isEmpty(d) ? 'none' : null; }) + .style('background', '#ffb'); + + warnings.append('h3') + .text(t('commit.warnings')); + + var warningLi = warnings.append('ul') + .attr('class', 'changeset-list') + .selectAll('li') + .data(function(d) { return d; }) + .enter() + .append('li') + .style() + .on('mouseover', mouseover) + .on('mouseout', mouseout) + .on('click', warningClick); + + warningLi.append('span') + .attr('class', 'alert icon icon-pre-text'); + + warningLi.append('strong').text(function(d) { + return d.message; + }); + // Save Section var saveSection = body.append('div') .attr('class','modal-section fillL cf'); @@ -90,34 +120,6 @@ iD.ui.Commit = function(context) { .attr('class', 'label') .text(t('commit.save')); - // Warnings - var warnings = body.selectAll('div.warning-section') - .data([iD.validate(changes, context.graph())]) - .enter() - .append('div') - .attr('class', 'modal-section warning-section fillL2') - .style('display', function(d) { return _.isEmpty(d) ? 'none' : null; }); - - warnings.append('h3') - .text(t('commit.warnings')); - - var warningLi = warnings.append('ul') - .attr('class', 'changeset-list') - .selectAll('li') - .data(function(d) { return d; }) - .enter() - .append('li') - .on('mouseover', mouseover) - .on('mouseout', mouseout) - .on('click', warningClick); - - warningLi.append('span') - .attr('class', 'alert icon icon-pre-text'); - - warningLi.append('strong').text(function(d) { - return d.message; - }); - var changeSection = body.selectAll('div.commit-section') .data([0]) .enter()