feat: isMobile-Methode mit Lazy Loading implementiert; Standortinformationen für mobile Browser auf readonly gesetzt.
This commit is contained in:
parent
e44d5f644c
commit
1388b40a6b
@ -80,7 +80,7 @@
|
|||||||
value: locale_date_dd_mm_yyyy(),
|
value: locale_date_dd_mm_yyyy(),
|
||||||
readOnly: true
|
readOnly: true
|
||||||
})
|
})
|
||||||
|
|
||||||
//city
|
//city
|
||||||
var location = await getLocation();
|
var location = await getLocation();
|
||||||
const id_city = PSPDFKit.generateInstantId()
|
const id_city = PSPDFKit.generateInstantId()
|
||||||
@ -103,6 +103,7 @@
|
|||||||
name: id_city,
|
name: id_city,
|
||||||
annotationIds: PSPDFKit.Immutable.List([annotation_city.id]),
|
annotationIds: PSPDFKit.Immutable.List([annotation_city.id]),
|
||||||
value: location.city,
|
value: location.city,
|
||||||
|
readOnly: isMobile()
|
||||||
})
|
})
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -46,11 +46,19 @@ async function getLocation() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const getLocaleDateString = _ => new Date().toLocaleDateString('de-DE')
|
const getLocaleDateString = _ => new Date().toLocaleDateString('de-DE')
|
||||||
|
|
||||||
function locale_date_dd_mm_yyyy() {
|
function locale_date_dd_mm_yyyy() {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const day = String(today.getDate()).padStart(2, '0');
|
const day = String(today.getDate()).padStart(2, '0');
|
||||||
const month = String(today.getMonth() + 1).padStart(2, '0');
|
const month = String(today.getMonth() + 1).padStart(2, '0');
|
||||||
const year = String(today.getFullYear()).slice(-4);
|
const year = String(today.getFullYear()).slice(-4);
|
||||||
return `${day}/${month}/${year}`;
|
return `${day}/${month}/${year}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
let __is_mobile = null;
|
||||||
|
function isMobile() {
|
||||||
|
if (__is_mobile === null) {
|
||||||
|
__is_mobile = /Mobi|Android/i.test(window.navigator.userAgent);
|
||||||
|
}
|
||||||
|
return __is_mobile;
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user