summaryrefslogtreecommitdiff
path: root/app
diff options
context:
space:
mode:
authorMike Greiling <mike@pixelcog.com>2016-11-20 00:23:12 -0600
committerMike Greiling <mike@pixelcog.com>2016-11-20 01:32:21 -0600
commit283bca3a2e06a2326a71ad4fcbf663da09cd0982 (patch)
tree0240bdff2fdd7e4e429823e6843f18db642a7dd1 /app
parent324482659a6fe463afb1547a96ecd2f61570a60e (diff)
downloadgitlab-ce-283bca3a2e06a2326a71ad4fcbf663da09cd0982.tar.gz
use param defaults and add spacing for readability
Diffstat (limited to 'app')
-rw-r--r--app/assets/javascripts/pager.js.es611
1 files changed, 7 insertions, 4 deletions
diff --git a/app/assets/javascripts/pager.js.es6 b/app/assets/javascripts/pager.js.es6
index 25033ea659f..2497c9e22b5 100644
--- a/app/assets/javascripts/pager.js.es6
+++ b/app/assets/javascripts/pager.js.es6
@@ -1,9 +1,9 @@
(() => {
const Pager = {
- init(limit, preload, disable, callback) {
- this.limit = limit != null ? limit : 0;
- this.disable = disable != null ? disable : false;
- this.callback = callback != null ? callback : $.noop;
+ init(limit = 0, preload = false, disable = false, callback = $.noop) {
+ this.limit = limit;
+ this.disable = disable;
+ this.callback = callback;
this.loading = $('.loading').first();
if (preload) {
this.offset = 0;
@@ -13,6 +13,7 @@
}
this.initLoadMore();
},
+
getOld() {
this.loading.show();
$.ajax({
@@ -27,6 +28,7 @@
dataType: 'json',
});
},
+
append(count, html) {
$('.content_list').append(html);
if (count > 0) {
@@ -35,6 +37,7 @@
this.disable = true;
}
},
+
initLoadMore() {
$(document).unbind('scroll');
$(document).endlessScroll({