Skip to content

Commit

Permalink
Merge pull request #5467 from quincylvania/tag-row-flexbox
Browse files Browse the repository at this point in the history
Keeps the raw tag editor buttons fixed-width using flexbox
  • Loading branch information
quincylvania authored Nov 4, 2018
2 parents 5a2444e + 1db80ff commit dcc654f
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 28 deletions.
30 changes: 8 additions & 22 deletions css/80_app.css
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,7 @@ button.active {
}

button.minor {
position: absolute;
top: 0;
right: 0;
height: 100%;
width: 10%;
border-radius: 0;
background-color: #fafafa;
}
Expand Down Expand Up @@ -2210,7 +2206,11 @@ div.combobox {
.tag-row {
width: 100%;
position: relative;
clear: both;
}
.tag-row .inner-wrap {
width: 100%;
position: relative;
display: flex;
}

.tag-row.readonly,
Expand All @@ -2236,14 +2236,9 @@ div.combobox {

.tag-row .key-wrap,
.tag-row .input-wrap-position {
width: 40%;
float: left;
flex: 1 0.5 100%;
height: 30px;
}
[dir='rtl'] .tag-row .key-wrap,
[dir='rtl'] .tag-row .input-wrap-position {
float: right;
}

.tag-row input.key {
font-weight: bold;
Expand Down Expand Up @@ -2271,15 +2266,13 @@ div.combobox {
}

.tag-row button {
position: absolute;
height: 31px;
right: 10%;
flex: 0 0 33px;
border: 1px solid #ccc;
border-top-width: 0;
border-left-width: 0;
}
[dir='rtl'] .tag-row button {
left: 10%;
border-left-width: 1px;
border-right-width: 0;
}
Expand Down Expand Up @@ -2313,16 +2306,10 @@ div.combobox {
}

.tag-row .tag-reference-button {
right: 0;
border-radius: 0;
width: 10%;
top: 0;
background: #fafafa;
}
[dir='rtl'] .tag-row .tag-reference-button {
left: auto;
right: auto;
margin-right: 35px;
border-left-width: 1px;
border-right-width: 0;
}
Expand Down Expand Up @@ -2378,7 +2365,6 @@ button.minor.tag-reference-loading {
}

.raw-tag-editor .tag-reference-body {
float: left;
width: 100%;
}

Expand All @@ -2387,7 +2373,7 @@ button.minor.tag-reference-loading {
color: #333;
}

.raw-tag-editor .tag-row:not(:last-child) .tag-reference-body {
.raw-tag-editor .tag-row:not(:last-child) .tag-reference-body.expanded {
border-bottom: 1px solid #ccc;
}

Expand Down
16 changes: 10 additions & 6 deletions modules/ui/raw_tag_editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,10 @@ export function uiRawTagEditor(context) {
.attr('class', 'tag-row cf')
.classed('readonly', isReadOnly);

enter
var innerWrap = enter.append('div')
.attr('class', 'inner-wrap');

innerWrap
.append('div')
.attr('class', 'key-wrap')
.append('input')
Expand All @@ -117,7 +120,7 @@ export function uiRawTagEditor(context) {
.on('blur', keyChange)
.on('change', keyChange);

enter
innerWrap
.append('div')
.attr('class', 'input-wrap-position')
.append('input')
Expand All @@ -129,7 +132,7 @@ export function uiRawTagEditor(context) {
.on('change', valueChange)
.on('keydown.push-more', pushMore);

enter
innerWrap
.append('button')
.attr('tabindex', -1)
.attr('class', 'remove minor')
Expand Down Expand Up @@ -169,9 +172,10 @@ export function uiRawTagEditor(context) {
reference.showing(false);
}

row
.call(reference.button)
.call(reference.body);
row.select('.inner-wrap')
.call(reference.button);

row.call(reference.body);
});

items.selectAll('input.key')
Expand Down

0 comments on commit dcc654f

Please sign in to comment.