jsketcher/web/app/3d/actions/action-helpers.js
2016-10-14 01:19:07 -07:00

17 lines
No EOL
606 B
JavaScript

export function checkForSelectedFaces(amount) {
return (state, app) => {
state.enabled = app.viewer.selectionMgr.selection.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.viewer.selectionMgr.selection.length >= amount;
if (!state.enabled) {
state.hint = amount == 1 ? 'requires a solid to be selected' : 'requires ' + amount + ' solids to be selected';
}
}
}