diff --git a/app/Http/Controllers/ApiController.php b/app/Http/Controllers/ApiController.php index 1b52e28f2..a596346bc 100644 --- a/app/Http/Controllers/ApiController.php +++ b/app/Http/Controllers/ApiController.php @@ -24,9 +24,9 @@ class ApiController extends Controller $likes = Like::whereProfileId($profile->id) ->orderBy('id', 'desc') - ->take(100) + ->take(1000) ->pluck('status_id'); - + return response()->json($likes); } } diff --git a/public/js/app.js b/public/js/app.js index 4160ff4b1..a7820a8a8 100644 Binary files a/public/js/app.js and b/public/js/app.js differ diff --git a/public/js/timeline.js b/public/js/timeline.js index fde930740..548ff63d5 100644 Binary files a/public/js/timeline.js and b/public/js/timeline.js differ diff --git a/public/mix-manifest.json b/public/mix-manifest.json index 9ec635527..c58ecdb81 100644 Binary files a/public/mix-manifest.json and b/public/mix-manifest.json differ diff --git a/resources/assets/js/bootstrap.js b/resources/assets/js/bootstrap.js index 6db7d4c98..e7da88eff 100644 --- a/resources/assets/js/bootstrap.js +++ b/resources/assets/js/bootstrap.js @@ -9,6 +9,7 @@ window.Popper = require('popper.js').default; */ try { + window.pixelfed = {}; window.$ = window.jQuery = require('jquery'); require('bootstrap'); window.InfiniteScroll = require('infinite-scroll'); diff --git a/resources/assets/js/components/commentform.js b/resources/assets/js/components/commentform.js index c7de6b42e..159a91531 100644 --- a/resources/assets/js/components/commentform.js +++ b/resources/assets/js/components/commentform.js @@ -5,7 +5,7 @@ $(document).ready(function() { el.focus(); }); - $('.comment-form').submit(function(e, data) { + $(document).on('submit', '.comment-form', function(e, data) { e.preventDefault(); let el = $(this); diff --git a/resources/assets/js/components/likebutton.js b/resources/assets/js/components/likebutton.js index 9ea111ac8..4283fcf1d 100644 --- a/resources/assets/js/components/likebutton.js +++ b/resources/assets/js/components/likebutton.js @@ -11,9 +11,8 @@ $(document).ready(function() { }) } - hydrateLikes(); - function hydrateLikes() { + pixelfed.hydrateLikes = function() { var likes = ls.get('likes'); $('.like-form').each(function(i, el) { var el = $(el); @@ -24,9 +23,11 @@ $(document).ready(function() { heart.addClass('fas fa-heart').removeClass('far fa-heart'); } }); - } + }; - $('.like-form').submit(function(e) { + pixelfed.hydrateLikes(); + + $(document).on('submit', '.like-form', function(e) { e.preventDefault(); var el = $(this); var id = el.data('id'); diff --git a/resources/assets/js/timeline.js b/resources/assets/js/timeline.js index 02ffbb239..576b3e71e 100644 --- a/resources/assets/js/timeline.js +++ b/resources/assets/js/timeline.js @@ -6,4 +6,7 @@ $(document).ready(function() { append: '.timeline-feed', history: false, }); + infScroll.on( 'append', function( response, path, items ) { + pixelfed.hydrateLikes(); + }); }); \ No newline at end of file