Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function downloadMember(d) {
d3_event.preventDefault();
// display the loading indicator
d3_select(this.parentNode).classed('tag-reference-loading', true);
context.loadEntity(d.id, function() {
updateDisclosureContent(_contentSelection);
});
}
// if the node is collapsed and has children expand
if (!node.data.expanded && Array.isArray(node.data.children) && node.data.children.length > 0) {
return this.expand(node);
}
return this.focusChild(node);
case RIGHT_ARROW:
event.preventDefault();
return this.focusNextSibling(node);
case UP_ARROW:
event.preventDefault();
return this.focusParent(node);
case LEFT_ARROW:
event.preventDefault();
return this.focusPreviousSibling(node);
case ENTER:
return this.toggle(node);
}
}
function toggle() {
d3_event.preventDefault();
_expanded = !_expanded;
if (_updatePreference) {
context.storage('disclosure.' + key + '.expanded', _expanded);
}
hideToggle
.classed('expanded', _expanded);
hideToggle.selectAll('.hide-toggle-icon')
.attr('xlink:href', _expanded ? '#icon-down'
: (textDirection === 'rtl') ? '#icon-backward' : '#icon-forward'
);
wrap
function click(d) {
d3_event.preventDefault();
if (d.location) {
context.map().centerZoomEase([d.location[1], d.location[0]], 19);
}
else if (d.entity) {
if (d.entity.type === 'node') {
context.map().center(d.entity.loc);
} else if (d.entity.type === 'way') {
var center = context.projection(context.map().center());
var edge = geoChooseEdge(context.childNodes(d.entity), center, context.projection);
context.map().center(edge.loc);
}
context.enter(modeSelect(context, [d.entity.id]));
} else {
context.zoomToEntity(d.id);
}
}
click: function zoomTo() {
d3_event.preventDefault();
d3_event.stopPropagation();
context.layers().layer('tasking').fitZoom();
}
}];
g.on("wheel", function() {
event.preventDefault();
event.stopImmediatePropagation();
});
g.on("dblclick.zoom", function() {
ENTER = 13,
ESC = 27,
LEFT = 37,
UP = 38,
RIGHT = 39;
const arrowKeys = display === "columns" ? [LEFT, UP, RIGHT, DOWN] : [UP, DOWN];
const linkHighlighted = isDescendant(this.resultContainer, event.target);
const tagName = event.target.tagName.toLowerCase();
if (activeKeyCode !== false && key === activeKeyCode && !["input", "textarea"].includes(tagName)) {
event.preventDefault();
this.textInput.focus();
}
else if (key === ESC && event.target === this.textInput) {
event.preventDefault();
this.textInput.blur();
}
else if (key === DOWN && event.target === this.textInput) {
event.preventDefault();
const firstLink = select(this.resultContainer).select("a");
if (firstLink.size()) firstLink.node().focus();
}
else if (arrowKeys.includes(key) && linkHighlighted) {
event.preventDefault();
if (key === DOWN) {
const nextLink = findSibling(event.target, "next");
if (nextLink) this.scrollToLink.bind(this)(nextLink);
}
else if (key === UP) {
.on('contextmenu', () => {
event.stopPropagation()
event.preventDefault()
this.dispatcher('contextmenu', {x: event.x, y: event.y, node: this})
})
g.append('rect')
function clickSetSource(d) {
if (d.id === 'custom' && !d.template()) {
return editCustom();
}
d3_event.preventDefault();
previous = context.background().baseLayerSource();
context.background().baseLayerSource(d);
selectLayer();
document.activeElement.blur();
}