mirror of
https://github.com/FoggedLens/iD.git
synced 2026-05-20 15:34:49 +02:00
Cleanup icons and fix RTL for preset categories
This commit is contained in:
@@ -159,7 +159,8 @@ export function uiPresetList(context) {
|
||||
var wrap = selection.append('div')
|
||||
.attr('class', 'preset-list-button-wrap category col12');
|
||||
|
||||
wrap.append('button')
|
||||
var button = wrap
|
||||
.append('button')
|
||||
.attr('class', 'preset-list-button')
|
||||
.classed('expanded', false)
|
||||
.call(uiPresetIcon()
|
||||
@@ -167,17 +168,24 @@ export function uiPresetList(context) {
|
||||
.preset(preset))
|
||||
.on('click', function() {
|
||||
var isExpanded = d3.select(this).classed('expanded');
|
||||
var triangle = isExpanded ? '▶ ' : '▼ ';
|
||||
d3.select(this).classed('expanded', !isExpanded);
|
||||
d3.select(this).selectAll('.label').text(triangle + preset.name());
|
||||
var iconName = isExpanded ?
|
||||
(textDirection === 'rtl' ? '#icon-backward' : '#icon-forward') : '#icon-down';
|
||||
d3.select(this)
|
||||
.classed('expanded', !isExpanded);
|
||||
d3.select(this).selectAll('div.label svg.icon use')
|
||||
.attr('href', iconName);
|
||||
item.choose();
|
||||
})
|
||||
.append('div')
|
||||
.attr('class', 'label')
|
||||
.text(function() {
|
||||
return '▶ ' + preset.name();
|
||||
});
|
||||
|
||||
var label = button
|
||||
.append('div')
|
||||
.attr('class', 'label');
|
||||
|
||||
label
|
||||
.call(svgIcon((textDirection === 'rtl' ? '#icon-backward' : '#icon-forward'), 'inline'))
|
||||
.append('span')
|
||||
.text(function() { return preset.name(); });
|
||||
|
||||
box = selection.append('div')
|
||||
.attr('class', 'subgrid col12')
|
||||
.style('max-height', '0px')
|
||||
@@ -190,6 +198,7 @@ export function uiPresetList(context) {
|
||||
.attr('class', 'preset-list fillL3 cf fl');
|
||||
}
|
||||
|
||||
|
||||
item.choose = function() {
|
||||
if (!box || !sublist) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user