Commit 995cb89f authored by Jacques Erasmus's avatar Jacques Erasmus

Merge branch 'tor/defect/remove-endless-scroll-jquery-animation' into 'master'

Remove calls to jQuery animations

See merge request gitlab-org/gitlab!57379
parents 1cf5e3de e9c0c464
---
title: Remove calls to jQuery animations to fix infinite scrolling on the Repository
commits page
merge_request: 57379
author:
type: fixed
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
* // using some custom options * // using some custom options
* $(document).endlessScroll({ * $(document).endlessScroll({
* fireOnce: false, * fireOnce: false,
* fireDelay: false,
* loader: "<div class=\"loading\"><div>", * loader: "<div class=\"loading\"><div>",
* callback: function(){ * callback: function(){
* alert("test"); * alert("test");
...@@ -30,7 +29,6 @@ ...@@ -30,7 +29,6 @@
* *
* bottomPixels integer the number of pixels from the bottom of the page that triggers the event * bottomPixels integer the number of pixels from the bottom of the page that triggers the event
* fireOnce boolean only fire once until the execution of the current event is completed * fireOnce boolean only fire once until the execution of the current event is completed
* fireDelay integer delay the subsequent firing, in milliseconds, 0 or false to disable delay
* loader string the HTML to be displayed during loading * loader string the HTML to be displayed during loading
* data string|function plain HTML data, can be either a string or a function that returns a string, * data string|function plain HTML data, can be either a string or a function that returns a string,
* when passed as a function it accepts one argument: fire sequence (the number * when passed as a function it accepts one argument: fire sequence (the number
...@@ -55,7 +53,6 @@ ...@@ -55,7 +53,6 @@
var defaults = { var defaults = {
bottomPixels : 50, bottomPixels : 50,
fireOnce : true, fireOnce : true,
fireDelay : 150,
loader : "<br />Loading...<br />", loader : "<br />Loading...<br />",
data : "", data : "",
insertAfter : "div:last", insertAfter : "div:last",
...@@ -102,21 +99,11 @@ ...@@ -102,21 +99,11 @@
data = typeof options.data == 'function' ? options.data.apply(this, [fireSequence]) : options.data; data = typeof options.data == 'function' ? options.data.apply(this, [fireSequence]) : options.data;
if (data !== false) { if (data !== false) {
$(options.insertAfter).after("<div id=\"endless_scroll_data\">" + data + "</div>"); $(options.insertAfter).after("<div>" + data + "</div>");
$("#endless_scroll_data").hide().fadeIn(250, function() {$(this).removeAttr("id");});
options.callback.apply(this, [fireSequence]); options.callback.apply(this, [fireSequence]);
if (options.fireDelay !== false || options.fireDelay !== 0) { fired = false;
$("body").after("<div id=\"endless_scroll_marker\"></div>");
// slight delay for preventing event firing twice
$("#endless_scroll_marker").fadeTo(options.fireDelay, 1, function() {
$(this).remove();
fired = false;
});
}
else
fired = false;
} }
$("#endless_scroll_loader").remove(); $("#endless_scroll_loader").remove();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment