From 0328e4f9da91fdd830cd9a7569eeb2710471509b Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Tue, 18 Dec 2018 11:00:40 -0500 Subject: [PATCH 1/4] add close button w/out css ref #5614 --- modules/ui/commit.js | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/modules/ui/commit.js b/modules/ui/commit.js index 4da3acbd9..cf82fd555 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -14,6 +14,8 @@ import { uiCommitWarnings } from './commit_warnings'; import { uiRawTagEditor } from './raw_tag_editor'; import { utilDetect } from '../util/detect'; import { utilRebind } from '../util'; +import { modeBrowse } from '../modes'; +import { svgIcon } from '../svg'; var _changeset; @@ -100,11 +102,23 @@ export function uiCommit(context) { var header = selection.selectAll('.header') .data([0]); - header.enter() + var headerTitle = header.enter() .append('div') - .attr('class', 'header fillL') + .attr('class', 'header fillL header-container') + + headerTitle + .append('div') + .attr('class', 'header-block') .append('h3') - .text(t('commit.title')); + .text(t('commit.title')) + + headerTitle + .append('div') + .attr('class', 'header-block') + .append('button') + .attr('class', 'close') + .on('click', function() { context.enter(modeBrowse(context)); }) + .call(svgIcon('#iD-icon-close')); var body = selection.selectAll('.body') .data([0]); From 18c021b5d5df9d486a1c405171184d4a5b572a85 Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Tue, 18 Dec 2018 11:09:26 -0500 Subject: [PATCH 2/4] add css ref #5614 --- css/80_app.css | 13 +++++++++++++ modules/ui/commit.js | 8 ++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/css/80_app.css b/css/80_app.css index 3927ee76e..92f2876de 100644 --- a/css/80_app.css +++ b/css/80_app.css @@ -648,6 +648,19 @@ button.add-note svg.icon { justify-content: center; } +.header-container { + display: flex; + justify-content: space-between; +} + +.header-block-outer { + width: 20%; +} + +.header-block-close { + display: flex; + justify-content: flex-end; +} /* Hide/Toggle collapsable sections (aka Disclosure) ------------------------------------------------------- */ diff --git a/modules/ui/commit.js b/modules/ui/commit.js index cf82fd555..7b16247ce 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -108,13 +108,17 @@ export function uiCommit(context) { headerTitle .append('div') - .attr('class', 'header-block') + .attr('class', 'header-block header-block-outer') + + headerTitle + .append('div') + .attr('class', 'header-block header-block') .append('h3') .text(t('commit.title')) headerTitle .append('div') - .attr('class', 'header-block') + .attr('class', 'header-block header-block-outer header-block-close') .append('button') .attr('class', 'close') .on('click', function() { context.enter(modeBrowse(context)); }) From ae9d43b0acc9f7f00ef901e060dbc74b3a1af7e0 Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Tue, 18 Dec 2018 11:16:31 -0500 Subject: [PATCH 3/4] remove double class ref #5614 --- modules/ui/commit.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ui/commit.js b/modules/ui/commit.js index 7b16247ce..8d2876bd2 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -112,7 +112,7 @@ export function uiCommit(context) { headerTitle .append('div') - .attr('class', 'header-block header-block') + .attr('class', 'header-block') .append('h3') .text(t('commit.title')) From 1471b551221102726b4a8dbf2413cb2ff14db890 Mon Sep 17 00:00:00 2001 From: Max Grossman Date: Tue, 18 Dec 2018 12:02:26 -0500 Subject: [PATCH 4/4] lint! ref #5614 --- modules/ui/commit.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ui/commit.js b/modules/ui/commit.js index 8d2876bd2..5d818a152 100644 --- a/modules/ui/commit.js +++ b/modules/ui/commit.js @@ -104,17 +104,17 @@ export function uiCommit(context) { var headerTitle = header.enter() .append('div') - .attr('class', 'header fillL header-container') + .attr('class', 'header fillL header-container'); headerTitle .append('div') - .attr('class', 'header-block header-block-outer') + .attr('class', 'header-block header-block-outer'); headerTitle .append('div') .attr('class', 'header-block') .append('h3') - .text(t('commit.title')) + .text(t('commit.title')); headerTitle .append('div')