Skip to content
GitLab
Explorer
Connexion
Navigation principale
Rechercher ou aller à…
Projet
stickerpicker
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
Wiki externe
Code
Requêtes de fusion
Dépôt
Branches
Validations
Étiquettes
Graphe du dépôt
Comparer les révisions
Extraits de code
Compilation
Pipelines
Jobs
Planifications de pipeline
Artéfacts
Déploiement
Releases
Registre de paquets
Registre de conteneurs
Registre de modèles
Opération
Environnements
Modules Terraform
Surveillance
Incidents
Analyse
Données d'analyse des chaînes de valeur
Analyse des contributeurs
Données d'analyse CI/CD
Données d'analyse du dépôt
Expériences du modèle
Aide
Aide
Support
Documentation de GitLab
Comparer les forfaits GitLab
Forum de la communauté GitLab
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
salixor
stickerpicker
Validations
eb6967fd
Valider
eb6967fd
rédigé
5 sept. 2020
par
Tulir Asokan
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
Add slightly hacky fix for scrolling to pack on Element iOS (ref #8)
parent
de072dcd
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
1
Afficher les modifications d'espaces
En ligne
Côte à côte
Affichage de
1 fichier modifié
web/index.js
+11
-1
11 ajouts, 1 suppression
web/index.js
avec
11 ajouts
et
1 suppression
web/index.js
+
11
−
1
Voir le fichier @
eb6967fd
...
@@ -16,6 +16,7 @@ let HOMESERVER_URL = "https://matrix-client.matrix.org"
...
@@ -16,6 +16,7 @@ let HOMESERVER_URL = "https://matrix-client.matrix.org"
const
makeThumbnailURL
=
mxc
=>
`
${
HOMESERVER_URL
}
/_matrix/media/r0/thumbnail/
${
mxc
.
substr
(
6
)}
?height=128&width=128&method=scale`
const
makeThumbnailURL
=
mxc
=>
`
${
HOMESERVER_URL
}
/_matrix/media/r0/thumbnail/
${
mxc
.
substr
(
6
)}
?height=128&width=128&method=scale`
// We need to detect iOS webkit because it has a bug related to scrolling non-fixed divs
// We need to detect iOS webkit because it has a bug related to scrolling non-fixed divs
// This is also used to fix scrolling to sections on Element iOS
const
isMobileSafari
=
navigator
.
userAgent
.
match
(
/
(
iPod|iPhone|iPad
)
/
)
&&
navigator
.
userAgent
.
match
(
/AppleWebKit/
)
const
isMobileSafari
=
navigator
.
userAgent
.
match
(
/
(
iPod|iPhone|iPad
)
/
)
&&
navigator
.
userAgent
.
match
(
/AppleWebKit/
)
class
App
extends
Component
{
class
App
extends
Component
{
...
@@ -119,8 +120,17 @@ class App extends Component {
...
@@ -119,8 +120,17 @@ class App extends Component {
}
}
}
}
// By default we just let the browser handle scrolling to sections, but webviews on Element iOS
// open the link in the browser instead of just scrolling there, so we need to scroll manually:
const
scrollToSection
=
(
evt
,
id
)
=>
{
const
pack
=
document
.
getElementById
(
`pack-
${
id
}
`
)
pack
.
scrollIntoView
({
block
:
"
start
"
,
behavior
:
"
instant
"
})
evt
.
preventDefault
()
}
const
NavBarItem
=
({
pack
})
=>
html
`
const
NavBarItem
=
({
pack
})
=>
html
`
<a href="#pack-
${
pack
.
id
}
" id="nav-
${
pack
.
id
}
" data-pack-id=
${
pack
.
id
}
title=
${
pack
.
title
}
>
<a href="#pack-
${
pack
.
id
}
" id="nav-
${
pack
.
id
}
" data-pack-id=
${
pack
.
id
}
title=
${
pack
.
title
}
onClick=
${
isMobileSafari
?
(
evt
=>
scrollToSection
(
evt
,
pack
.
id
))
:
undefined
}
>
<div class="sticker">
<div class="sticker">
<img src=
${
makeThumbnailURL
(
pack
.
stickers
[
0
].
url
)}
<img src=
${
makeThumbnailURL
(
pack
.
stickers
[
0
].
url
)}
alt=
${
pack
.
stickers
[
0
].
body
}
class="visible" />
alt=
${
pack
.
stickers
[
0
].
body
}
class="visible" />
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
Aperçu
0%
Chargement en cours
Veuillez réessayer
ou
joindre un nouveau fichier
.
Annuler
You are about to add
0
people
to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Enregistrer le commentaire
Annuler
Please
se connecter
to comment