All files / roosterjs-content-model-plugins/lib/imageEdit/Resizer updateSideHandlesVisibility.ts

100% Statements 9/9
83.33% Branches 10/12
100% Functions 2/2
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13      1x 19x 131x 131x 131x 131x 131x      
/**
 * @internal
 */
export function updateSideHandlesVisibility(handles: HTMLDivElement[], isSmall: boolean) {
    handles.forEach(handle => {
        const { y, x } = handle.dataset;
        const coordinate = (y ?? '') + (x ?? '');
        const directions = ['n', 's', 'e', 'w'];
        const isSideHandle = directions.indexOf(coordinate) > -1;
        handle.style.display = isSideHandle && isSmall ? 'none' : '';
    });
}