5180 fichiers 38.5 Mo 0 téléchargements 191 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / common / native-text / nativeTextEnabled.ts
nativeTextEnabled.ts 791 o Télécharger le fichier
import { GetConfigurationValue } from '../../api/octane/GetConfigurationValue';

let forced: boolean | null = null;

/** Tests turn the native labels on (jsdom has no canvas, so they are off there by default); null restores the default. */
export const forceNativeTextEnabled = (value: boolean | null) => {
    forced = value;
};

/**
 * Whether labels are drawn with AIR's native text renderer. `ui.native.text.enabled` (default true) turns it off for the whole
 * client, e.g. for slow devices; jsdom never draws them.
 */
export const isNativeTextEnabled = () => {
    if (forced !== null) return forced;
    if (typeof navigator === 'undefined' || /jsdom/i.test(navigator.userAgent)) return false;

    return GetConfigurationValue<boolean>('ui.native.text.enabled', true) !== false;
};
15Sujets
1Dépôts
20Membres
2En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser