Skip to content

Commit

Permalink
Merge pull request #5622 from openstreetmap/5614
Browse files Browse the repository at this point in the history
5614 - add close button to commit side bar
  • Loading branch information
bhousel authored Dec 18, 2018
2 parents 007faea + 1471b55 commit bff0ea2
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
13 changes: 13 additions & 0 deletions css/80_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -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)
------------------------------------------------------- */
Expand Down
22 changes: 20 additions & 2 deletions modules/ui/commit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -100,11 +102,27 @@ 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 header-block-outer');

headerTitle
.append('div')
.attr('class', 'header-block')
.append('h3')
.text(t('commit.title'));

headerTitle
.append('div')
.attr('class', 'header-block header-block-outer header-block-close')
.append('button')
.attr('class', 'close')
.on('click', function() { context.enter(modeBrowse(context)); })
.call(svgIcon('#iD-icon-close'));

var body = selection.selectAll('.body')
.data([0]);
Expand Down

0 comments on commit bff0ea2

Please sign in to comment.