Add coexistence checks to all enqueue methods to prevent loading both React and Grid.js assets simultaneously. Changes: - ReactAdmin.php: Only enqueue React assets when ?react=1 - Init.php: Skip Grid.js when React active on admin pages - Form.php, Coupon.php, Access.php: Restore classic assets when ?react=0 - Customer.php, Product.php, License.php: Add coexistence checks Now the toggle between Classic and React versions works correctly. Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
26 lines
798 B
JavaScript
26 lines
798 B
JavaScript
import { calcLength } from './delta-calc.mjs';
|
|
|
|
function isAxisDeltaZero(delta) {
|
|
return delta.translate === 0 && delta.scale === 1;
|
|
}
|
|
function isDeltaZero(delta) {
|
|
return isAxisDeltaZero(delta.x) && isAxisDeltaZero(delta.y);
|
|
}
|
|
function boxEquals(a, b) {
|
|
return (a.x.min === b.x.min &&
|
|
a.x.max === b.x.max &&
|
|
a.y.min === b.y.min &&
|
|
a.y.max === b.y.max);
|
|
}
|
|
function boxEqualsRounded(a, b) {
|
|
return (Math.round(a.x.min) === Math.round(b.x.min) &&
|
|
Math.round(a.x.max) === Math.round(b.x.max) &&
|
|
Math.round(a.y.min) === Math.round(b.y.min) &&
|
|
Math.round(a.y.max) === Math.round(b.y.max));
|
|
}
|
|
function aspectRatio(box) {
|
|
return calcLength(box.x) / calcLength(box.y);
|
|
}
|
|
|
|
export { aspectRatio, boxEquals, boxEqualsRounded, isDeltaZero };
|