From 9aacdbaefbda24c60f12d43eba3fc04bd6664644 Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 9 Jul 2019 16:48:05 -0300 Subject: [PATCH 1/2] fix 50 custom emoji --- app/emoji-custom/client/admin/adminEmoji.js | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/app/emoji-custom/client/admin/adminEmoji.js b/app/emoji-custom/client/admin/adminEmoji.js index 3d64e3b189ce..ead1976ada0a 100644 --- a/app/emoji-custom/client/admin/adminEmoji.js +++ b/app/emoji-custom/client/admin/adminEmoji.js @@ -31,7 +31,10 @@ Template.adminEmoji.helpers({ hasMore() { if (Template.instance().limit != null) { if (typeof Template.instance().customemoji === 'function') { - return Template.instance().limit.get() === Template.instance().customemoji().length; + return ( + Template.instance().limit.get() + === Template.instance().customemoji().length + ); } } return false; @@ -42,6 +45,18 @@ Template.adminEmoji.helpers({ data: Template.instance().tabBarData.get(), }; }, + onTableScroll() { + const instance = Template.instance(); + return function(currentTarget) { + if ((currentTarget.offsetHeight + currentTarget.scrollTop) < (currentTarget.scrollHeight - 100)) { + return; + } + if (Template.instance().limit.get() > Template.instance().customemoji().length) { + return false; + } + instance.limit.set(instance.limit.get() + 50); + }; + }, onTableItemClick() { const instance = Template.instance(); return function({ _id }) { From 934b41ded1055e950e504888a164909732dda21f Mon Sep 17 00:00:00 2001 From: Guilherme Gazzo Date: Tue, 9 Jul 2019 17:45:32 -0300 Subject: [PATCH 2/2] opss --- app/emoji-custom/client/admin/adminEmoji.js | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/app/emoji-custom/client/admin/adminEmoji.js b/app/emoji-custom/client/admin/adminEmoji.js index ead1976ada0a..7a46f4c9cb0c 100644 --- a/app/emoji-custom/client/admin/adminEmoji.js +++ b/app/emoji-custom/client/admin/adminEmoji.js @@ -31,10 +31,7 @@ Template.adminEmoji.helpers({ hasMore() { if (Template.instance().limit != null) { if (typeof Template.instance().customemoji === 'function') { - return ( - Template.instance().limit.get() - === Template.instance().customemoji().length - ); + return Template.instance().limit.get() === Template.instance().customemoji().length; } } return false;