Revert references to the v3 UI in the Keyboard Shortcuts menu

Remove unused preset favoriting functionality
This commit is contained in:
Quincy Morgan
2019-12-20 12:05:04 -05:00
parent f357023349
commit f6769238ed
8 changed files with 11 additions and 169 deletions
-8
View File
@@ -7,7 +7,6 @@ import { tooltip } from '../util/tooltip';
import { actionChangeTags } from '../actions/change_tags';
import { modeBrowse } from '../modes/browse';
import { svgIcon } from '../svg/icon';
import { uiPresetFavoriteButton } from './preset_favorite_button';
import { uiPresetIcon } from './preset_icon';
import { uiQuickLinks } from './quick_links';
import { uiRawMemberEditor } from './raw_member_editor';
@@ -30,7 +29,6 @@ export function uiEntityEditor(context) {
var _entityID;
var _activePreset;
var _tagReference;
var _presetFavorite;
var entityIssues = uiEntityIssues(context);
var quickLinks = uiQuickLinks();
@@ -134,11 +132,6 @@ export function uiEntityEditor(context) {
body = body
.merge(bodyEnter);
if (_presetFavorite) {
body.selectAll('.preset-list-button-wrap')
.call(_presetFavorite.button);
}
// update header
if (_tagReference) {
body.selectAll('.preset-list-button-wrap')
@@ -364,7 +357,6 @@ export function uiEntityEditor(context) {
_tagReference = uiTagReference(_activePreset.reference(context.geometry(_entityID)), context)
.showing(false);
}
_presetFavorite = uiPresetFavoriteButton(_activePreset, context.geometry(_entityID), context);
return entityEditor;
};
-56
View File
@@ -1,56 +0,0 @@
import {
event as d3_event,
select as d3_select
} from 'd3-selection';
import { t } from '../util/locale';
import { svgIcon } from '../svg/icon';
export function uiPresetFavoriteButton(preset, geom, context, klass) {
geom = context.presets().fallback(geom).id;
var presetFavorite = {};
var _button = d3_select(null);
presetFavorite.button = function(selection) {
// disable favoriting for now
var canFavorite = false;//geom !== 'relation' && preset.searchable !== false;
_button = selection.selectAll('.preset-favorite-button')
.data(canFavorite ? [0] : []);
_button.exit().remove();
_button = _button.enter()
.insert('button', '.tag-reference-button')
.attr('class', 'preset-favorite-button ' + klass)
.attr('title', t('icons.favorite'))
.attr('tabindex', -1)
.call(svgIcon('#iD-icon-favorite'))
.merge(_button);
_button
.on('click', function () {
d3_event.stopPropagation();
d3_event.preventDefault();
context.presets().toggleFavorite(preset, geom);
update();
});
update();
};
function update() {
_button
.classed('active', context.presets().favoriteMatching(preset, geom));
}
context.presets().on('favoritePreset.button-' + preset.id.replace(/[^a-zA-Z\d:]/g, '-') + '-' + geom, update);
return presetFavorite;
}
-4
View File
@@ -35,10 +35,6 @@ export function uiTopToolbar(context) {
context.layers()
.on('change.topToolbar', debouncedUpdate);
context.presets()
.on('favoritePreset.topToolbar', update)
.on('recentsChange.topToolbar', update);
update();
function update() {