mirror of
https://github.com/FoggedLens/iD.git
synced 2026-02-13 09:12:52 +00:00
Properly disable more operations for single nodes that aren't visible
This commit is contained in:
@@ -113,7 +113,7 @@ export function operationCopy(context, selectedIDs) {
|
||||
var extent = nodes.reduce(function(extent, node) {
|
||||
return extent.extend(node.extent(context.graph()));
|
||||
}, geoExtent());
|
||||
if (extent.area() && extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
if (extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
return 'too_large';
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -72,7 +72,7 @@ export function operationDelete(context, selectedIDs) {
|
||||
|
||||
|
||||
operation.disabled = function() {
|
||||
if (extent.area() && extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
if (extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
return 'too_large';
|
||||
} else if (someMissing()) {
|
||||
return 'not_downloaded';
|
||||
|
||||
@@ -57,7 +57,7 @@ export function operationExtract(context, selectedIDs) {
|
||||
|
||||
operation.disabled = function () {
|
||||
|
||||
if (_extent && _extent.area() && _extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
if (_extent && _extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
return 'too_large';
|
||||
} else if (selectedIDs.some(function(entityID) {
|
||||
return context.graph().geometry(entityID) === 'vertex' && context.hasHiddenConnections(entityID);
|
||||
|
||||
@@ -26,7 +26,7 @@ export function operationMove(context, selectedIDs) {
|
||||
|
||||
|
||||
operation.disabled = function() {
|
||||
if (extent.area() && extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
if (extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
return 'too_large';
|
||||
} else if (someMissing()) {
|
||||
return 'not_downloaded';
|
||||
|
||||
@@ -89,7 +89,7 @@ export function operationOrthogonalize(context, selectedIDs) {
|
||||
return 'multiple_blockers';
|
||||
}
|
||||
return actionDisableds[0];
|
||||
} else if (_type !== 'corner' &&
|
||||
} else if (_extent &&
|
||||
_extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
return 'too_large';
|
||||
} else if (someMissing()) {
|
||||
|
||||
@@ -44,7 +44,7 @@ export function operationReflect(context, selectedIDs, axis) {
|
||||
|
||||
// don't cache this because the visible extent could change
|
||||
operation.disabled = function() {
|
||||
if (extent.area() && extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
if (extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
return 'too_large';
|
||||
} else if (someMissing()) {
|
||||
return 'not_downloaded';
|
||||
|
||||
@@ -26,7 +26,7 @@ export function operationRotate(context, selectedIDs) {
|
||||
|
||||
operation.disabled = function() {
|
||||
|
||||
if (extent.area() && extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
if (extent.percentContainedIn(context.map().extent()) < 0.8) {
|
||||
return 'too_large';
|
||||
} else if (someMissing()) {
|
||||
return 'not_downloaded';
|
||||
|
||||
Reference in New Issue
Block a user