Commit 283bca3a authored by Mike Greiling's avatar Mike Greiling

use param defaults and add spacing for readability

parent 32448265
(() => { (() => {
const Pager = { const Pager = {
init(limit, preload, disable, callback) { init(limit = 0, preload = false, disable = false, callback = $.noop) {
this.limit = limit != null ? limit : 0; this.limit = limit;
this.disable = disable != null ? disable : false; this.disable = disable;
this.callback = callback != null ? callback : $.noop; this.callback = callback;
this.loading = $('.loading').first(); this.loading = $('.loading').first();
if (preload) { if (preload) {
this.offset = 0; this.offset = 0;
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
} }
this.initLoadMore(); this.initLoadMore();
}, },
getOld() { getOld() {
this.loading.show(); this.loading.show();
$.ajax({ $.ajax({
...@@ -27,6 +28,7 @@ ...@@ -27,6 +28,7 @@
dataType: 'json', dataType: 'json',
}); });
}, },
append(count, html) { append(count, html) {
$('.content_list').append(html); $('.content_list').append(html);
if (count > 0) { if (count > 0) {
...@@ -35,6 +37,7 @@ ...@@ -35,6 +37,7 @@
this.disable = true; this.disable = true;
} }
}, },
initLoadMore() { initLoadMore() {
$(document).unbind('scroll'); $(document).unbind('scroll');
$(document).endlessScroll({ $(document).endlessScroll({
......
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