Skip to content
GitLab
Explorer
Connexion
S'inscrire
Navigation principale
Rechercher ou aller à…
Projet
P
parlote-facil
Gestion
Activité
Membres
Labels
Programmation
Tickets
Tableaux des tickets
Jalons
Wiki
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 conteneur
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é
Contribuer à GitLab
Donner votre avis
Raccourcis clavier
?
Extraits de code
Groupes
Projets
Afficher davantage de fils d'Ariane
facil
parlote-facil
Validations
bc0c92ec
Valider
bc0c92ec
rédigé
13 years ago
par
danielgrippi
Validation de
Dennis Collinson
13 years ago
Parcourir les fichiers
Options
Téléchargements
Correctifs
Plain Diff
added inf. scroll to stream; passing inf. scroll cukes
parent
33e0de94
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
Modifications
2
Masquer les modifications d'espaces
En ligne
Côte à côte
Affichage de
2 fichiers modifiés
features/step_definitions/custom_web_steps.rb
+0
-2
0 ajout, 2 suppressions
features/step_definitions/custom_web_steps.rb
public/javascripts/app/views/stream_view.js
+22
-0
22 ajouts, 0 suppression
public/javascripts/app/views/stream_view.js
avec
22 ajouts
et
2 suppressions
features/step_definitions/custom_web_steps.rb
+
0
−
2
Voir le fichier @
bc0c92ec
...
@@ -179,8 +179,6 @@ end
...
@@ -179,8 +179,6 @@ end
And
/^I scroll down$/
do
And
/^I scroll down$/
do
evaluate_script
(
"window.scrollBy(0,3000000)"
)
evaluate_script
(
"window.scrollBy(0,3000000)"
)
sleep
1
wait_until
(
30
)
{
evaluate_script
(
'$("#infscr-loading:visible").length'
)
==
0
}
step
"I wait for the ajax to finish"
step
"I wait for the ajax to finish"
end
end
...
...
Ce diff est replié.
Cliquez pour l'agrandir.
public/javascripts/app/views/stream_view.js
+
22
−
0
Voir le fichier @
bc0c92ec
...
@@ -9,9 +9,26 @@ app.views.Stream = Backbone.View.extend({
...
@@ -9,9 +9,26 @@ app.views.Stream = Backbone.View.extend({
this
.
publisher
=
new
app
.
views
.
Publisher
({
collection
:
this
.
collection
});
this
.
publisher
=
new
app
.
views
.
Publisher
({
collection
:
this
.
collection
});
// inf scroll
// we're using this._loading to keep track of backbone's collection
// fetching state... is there a better way to do this?
var
throttledScroll
=
_
.
throttle
(
$
.
proxy
(
this
.
infScroll
,
this
),
200
);
$
(
window
).
scroll
(
throttledScroll
);
return
this
;
return
this
;
},
},
infScroll
:
function
(
options
)
{
var
$window
=
$
(
window
);
var
distFromTop
=
$window
.
height
()
+
$window
.
scrollTop
();
var
distFromBottom
=
$
(
document
).
height
()
-
distFromTop
;
var
bufferPx
=
300
;
if
(
distFromBottom
<
bufferPx
&&
!
this
.
_loading
)
{
this
.
render
();
}
},
prependPost
:
function
(
post
)
{
prependPost
:
function
(
post
)
{
var
postView
=
new
app
.
views
.
Post
({
model
:
post
});
var
postView
=
new
app
.
views
.
Post
({
model
:
post
});
$
(
this
.
el
).
prepend
(
postView
.
render
().
el
);
$
(
this
.
el
).
prepend
(
postView
.
render
().
el
);
...
@@ -32,6 +49,8 @@ app.views.Stream = Backbone.View.extend({
...
@@ -32,6 +49,8 @@ app.views.Stream = Backbone.View.extend({
href
:
this
.
collection
.
url
(),
href
:
this
.
collection
.
url
(),
id
:
"
paginate
"
id
:
"
paginate
"
}).
text
(
'
Load more posts
'
));
}).
text
(
'
Load more posts
'
));
this
.
_loading
=
false
;
},
},
render
:
function
(
evt
)
{
render
:
function
(
evt
)
{
...
@@ -39,6 +58,9 @@ app.views.Stream = Backbone.View.extend({
...
@@ -39,6 +58,9 @@ app.views.Stream = Backbone.View.extend({
var
self
=
this
;
var
self
=
this
;
self
.
addLoader
();
self
.
addLoader
();
this
.
_loading
=
true
;
self
.
collection
.
fetch
({
self
.
collection
.
fetch
({
add
:
true
,
add
:
true
,
success
:
$
.
proxy
(
this
.
collectionFetched
,
self
)
success
:
$
.
proxy
(
this
.
collectionFetched
,
self
)
...
...
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
Veuillez vous
inscrire
ou vous
se connecter
pour commenter