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>
35 lines
836 B
JavaScript
35 lines
836 B
JavaScript
'use strict';
|
|
|
|
function compressFont(node) {
|
|
const list = node.children;
|
|
|
|
list.forEachRight(function(node, item) {
|
|
if (node.type === 'Identifier') {
|
|
if (node.name === 'bold') {
|
|
item.data = {
|
|
type: 'Number',
|
|
loc: node.loc,
|
|
value: '700'
|
|
};
|
|
} else if (node.name === 'normal') {
|
|
const prev = item.prev;
|
|
|
|
if (prev && prev.data.type === 'Operator' && prev.data.value === '/') {
|
|
this.remove(prev);
|
|
}
|
|
|
|
this.remove(item);
|
|
}
|
|
}
|
|
});
|
|
|
|
if (list.isEmpty) {
|
|
list.insert(list.createItem({
|
|
type: 'Identifier',
|
|
name: 'normal'
|
|
}));
|
|
}
|
|
}
|
|
|
|
module.exports = compressFont;
|