Fix iPad PDF scroll issue - detect iOS and open in new tab
This commit is contained in:
parent
400678f4af
commit
159ce11eb8
2 changed files with 13 additions and 8 deletions
|
|
@ -15,10 +15,10 @@ class DatabaseSeeder extends Seeder
|
||||||
*/
|
*/
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
// Call specific seeders instead of using factories
|
// Migration complete - no automatic seeding
|
||||||
$this->call([
|
// Data is already in production database
|
||||||
AdminSeeder::class,
|
// Only seed manually if needed:
|
||||||
V1DataMigrationSeeder::class,
|
// php artisan db:seed --class=AdminSeeder
|
||||||
]);
|
// php artisan db:seed --class=V1DataMigrationSeeder
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -45,9 +45,14 @@ const openDocument = (doc: Document, event: MouseEvent) => {
|
||||||
|
|
||||||
const documentUrl = `/api/documents/${doc.id}/download`;
|
const documentUrl = `/api/documents/${doc.id}/download`;
|
||||||
|
|
||||||
// On mobile (< 768px), open PDF directly in new tab
|
// Detect iOS devices (iPhone, iPad, iPod)
|
||||||
// On desktop, use modal viewer
|
// Modern iPads report as MacIntel, so check for touch points
|
||||||
if (window.innerWidth < 768) {
|
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) ||
|
||||||
|
(navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1);
|
||||||
|
|
||||||
|
// On mobile (< 768px) or iOS devices, open PDF directly in new tab
|
||||||
|
// On desktop (non-iOS), use modal viewer
|
||||||
|
if (window.innerWidth < 768 || isIOS) {
|
||||||
window.open(documentUrl, '_blank');
|
window.open(documentUrl, '_blank');
|
||||||
} else {
|
} else {
|
||||||
selectedDocument.value = {
|
selectedDocument.value = {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue