Merge pull request #1540 from valadaptive/refactor-device-check

Refactor mobile device check
This commit is contained in:
Cohee
2023-12-15 17:01:32 +02:00
committed by GitHub
10 changed files with 39 additions and 68 deletions

View File

@ -169,7 +169,6 @@ import {
import { EventEmitter } from './lib/eventemitter.js';
import { markdownExclusionExt } from './scripts/showdown-exclusion.js';
import { NOTE_MODULE_NAME, initAuthorsNote, metadata_keys, setFloatingPrompt, shouldWIAddPrompt } from './scripts/authors-note.js';
import { getDeviceInfo } from './scripts/RossAscends-mods.js';
import { registerPromptManagerMigration } from './scripts/PromptManager.js';
import { getRegexedString, regex_placement } from './scripts/extensions/regex/engine.js';
import { FILTER_TYPES, FilterHelper } from './scripts/filters.js';
@ -6834,8 +6833,7 @@ function openCharacterWorldPopup() {
template.find('.character_name').text(name);
// Not needed on mobile
const deviceInfo = getDeviceInfo();
if (deviceInfo && deviceInfo.device.type === 'desktop') {
if (!isMobile()) {
$(extraSelect).select2({
width: '100%',
placeholder: 'No auxillary Lorebooks set. Click here to select.',
@ -7812,7 +7810,7 @@ function addDebugFunctions() {
jQuery(async function () {
if (isMobile() === true) {
if (isMobile()) {
console.debug('hiding movingUI and sheldWidth toggles for mobile');
$('#sheldWidthToggleBlock').hide();
$('#movingUIModeCheckBlock').hide();