mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 01:02:58 +00:00
Add 'list'/'text' toggle buttons
This commit is contained in:
@@ -55,9 +55,12 @@ module.exports = function buildData() {
|
||||
|
||||
// Font Awesome icons used
|
||||
var faIcons = {
|
||||
'fas-long-arrow-alt-right': {}
|
||||
'fas-i-cursor': {},
|
||||
'fas-long-arrow-alt-right': {},
|
||||
'fas-th-list': {}
|
||||
};
|
||||
|
||||
// The Noun Project icons used
|
||||
var tnpIcons = {};
|
||||
|
||||
// Start clean
|
||||
|
||||
@@ -2407,10 +2407,40 @@ div.combobox {
|
||||
flex-flow: row nowrap;
|
||||
flex-direction: row-reverse;
|
||||
margin-top: -25px;
|
||||
padding: 0 3px;
|
||||
}
|
||||
.raw-tag-option {
|
||||
padding: 5px;
|
||||
button.raw-tag-option {
|
||||
flex: 0 0 20px;
|
||||
height: 20px;
|
||||
width: 20px;
|
||||
background: #aaa;
|
||||
color: #eee;
|
||||
margin: 0 3px;
|
||||
}
|
||||
button.raw-tag-option:focus,
|
||||
button.raw-tag-option:hover,
|
||||
button.raw-tag-option.active {
|
||||
color: #fff;
|
||||
background: #597be7;
|
||||
}
|
||||
button.raw-tag-option.selected {
|
||||
color: #fff;
|
||||
background: #7092ff;
|
||||
}
|
||||
button.raw-tag-option svg.icon {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
vertical-align: text-bottom;
|
||||
}
|
||||
[dir='ltr'] button.raw-tag-option-list {
|
||||
-moz-transform: scaleX(-1);
|
||||
-o-transform: scaleX(-1);
|
||||
-webkit-transform: scaleX(-1);
|
||||
transform: scaleX(-1);
|
||||
filter: FlipH;
|
||||
-ms-filter: "FlipH";
|
||||
}
|
||||
|
||||
|
||||
.tag-text {
|
||||
width: 100%;
|
||||
|
||||
@@ -14,8 +14,8 @@ export function uiRawTagEditor(context) {
|
||||
var taginfo = services.taginfo;
|
||||
var dispatch = d3_dispatch('change');
|
||||
var availableViews = [
|
||||
{ id: 'text' },
|
||||
{ id: 'list' }
|
||||
{ id: 'text', icon: '#fas-i-cursor' },
|
||||
{ id: 'list', icon: '#fas-th-list' }
|
||||
];
|
||||
|
||||
var _tagView = (context.storage('raw-tag-editor-view') || 'list'); // 'list, 'text'
|
||||
@@ -94,16 +94,25 @@ export function uiRawTagEditor(context) {
|
||||
.enter();
|
||||
|
||||
optionEnter
|
||||
.append('a')
|
||||
.attr('class', 'raw-tag-option')
|
||||
.attr('href', '#')
|
||||
.text(function(d) { return d.id; })
|
||||
.append('button')
|
||||
.attr('class', function(d) {
|
||||
return 'raw-tag-option raw-tag-option-' + d.id + (_tagView === d.id ? ' selected' : '');
|
||||
})
|
||||
.attr('title', function(d) { return d.id; })
|
||||
.on('click', function(d) {
|
||||
_tagView = d.id;
|
||||
context.storage('raw-tag-editor-view', d.id);
|
||||
|
||||
wrap.selectAll('.raw-tag-option')
|
||||
.classed('selected', function(datum) { return datum === d; });
|
||||
wrap.selectAll('.tag-text')
|
||||
.classed('hide', (d.id !== 'text'));
|
||||
wrap.selectAll('.tag-list, .add-row')
|
||||
.classed('hide', (d.id !== 'list'));
|
||||
})
|
||||
.each(function(d) {
|
||||
d3_select(this)
|
||||
.call(svgIcon(d.icon));
|
||||
});
|
||||
|
||||
|
||||
|
||||
1
svg/fontawesome/fas-i-cursor.svg
Normal file
1
svg/fontawesome/fas-i-cursor.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="i-cursor" class="svg-inline--fa fa-i-cursor fa-w-8" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 256 512"><path fill="currentColor" d="M256 52.048V12.065C256 5.496 250.726.148 244.158.066 211.621-.344 166.469.011 128 37.959 90.266.736 46.979-.114 11.913.114 5.318.157 0 5.519 0 12.114v39.645c0 6.687 5.458 12.078 12.145 11.998C38.111 63.447 96 67.243 96 112.182V224H60c-6.627 0-12 5.373-12 12v40c0 6.627 5.373 12 12 12h36v112c0 44.932-56.075 48.031-83.95 47.959C5.404 447.942 0 453.306 0 459.952v39.983c0 6.569 5.274 11.917 11.842 11.999 32.537.409 77.689.054 116.158-37.894 37.734 37.223 81.021 38.073 116.087 37.845 6.595-.043 11.913-5.405 11.913-12V460.24c0-6.687-5.458-12.078-12.145-11.998C217.889 448.553 160 444.939 160 400V288h36c6.627 0 12-5.373 12-12v-40c0-6.627-5.373-12-12-12h-36V112.182c0-44.932 56.075-48.213 83.95-48.142 6.646.018 12.05-5.346 12.05-11.992z"></path></svg>
|
||||
|
After Width: | Height: | Size: 970 B |
1
svg/fontawesome/fas-th-list.svg
Normal file
1
svg/fontawesome/fas-th-list.svg
Normal file
@@ -0,0 +1 @@
|
||||
<svg aria-hidden="true" focusable="false" data-prefix="fas" data-icon="th-list" class="svg-inline--fa fa-th-list fa-w-16" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><path fill="currentColor" d="M149.333 216v80c0 13.255-10.745 24-24 24H24c-13.255 0-24-10.745-24-24v-80c0-13.255 10.745-24 24-24h101.333c13.255 0 24 10.745 24 24zM0 376v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H24c-13.255 0-24 10.745-24 24zM125.333 32H24C10.745 32 0 42.745 0 56v80c0 13.255 10.745 24 24 24h101.333c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24zm80 448H488c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24zm-24-424v80c0 13.255 10.745 24 24 24H488c13.255 0 24-10.745 24-24V56c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24zm24 264H488c13.255 0 24-10.745 24-24v-80c0-13.255-10.745-24-24-24H205.333c-13.255 0-24 10.745-24 24v80c0 13.255 10.745 24 24 24z"></path></svg>
|
||||
|
After Width: | Height: | Size: 1004 B |
Reference in New Issue
Block a user