jsketcher/web/app/3d/actions/action-helpers.js
2018-01-05 01:41:15 -08:00

17 lines
No EOL
586 B
JavaScript

export function checkForSelectedFaces(amount) {
return (state, app) => {
state.enabled = app.getFaceSelection().length >= amount;
if (!state.enabled) {
state.hint = amount === 1 ? 'requires a face to be selected' : 'requires ' + amount + ' faces to be selected';
}
}
}
export function checkForSelectedSolids(amount) {
return (state, app) => {
state.enabled = app.getFaceSelection().length >= amount;
if (!state.enabled) {
state.hint = amount === 1 ? 'requires a solid to be selected' : 'requires ' + amount + ' solids to be selected';
}
}
}