From d46cf454b3c08fbe58937f8d1c3a0caf37909a40 Mon Sep 17 00:00:00 2001 From: Bastard Operator Date: Sun, 3 Jan 2021 02:44:11 +0100 Subject: [PATCH] Implemented account images indexes controlling on fedilove.js --- src/routes/_layout.html | 4 ++-- src/scss/themes/ozark.scss | 1 + static/fedilove-no-react.js | 23 +++++++++++++++++++++++ 3 files changed, 26 insertions(+), 2 deletions(-) diff --git a/src/routes/_layout.html b/src/routes/_layout.html index f7e5a32a..fb1289db 100644 --- a/src/routes/_layout.html +++ b/src/routes/_layout.html @@ -7,8 +7,8 @@
diff --git a/src/scss/themes/ozark.scss b/src/scss/themes/ozark.scss index 0ef3a73f..72a0d710 100644 --- a/src/scss/themes/ozark.scss +++ b/src/scss/themes/ozark.scss @@ -311,6 +311,7 @@ div.main-content.account { margin: auto; article.status-article { + cursor: initial !important; background: none !important; padding: 0; diff --git a/static/fedilove-no-react.js b/static/fedilove-no-react.js index ac5abe1c..c82cd141 100644 --- a/static/fedilove-no-react.js +++ b/static/fedilove-no-react.js @@ -73,6 +73,26 @@ var fediloveUI = { cbackFunc(swiperightBol); e.preventDefault(); }, false); }, + meetAccountImageDirection: function(direction) { + if (direction === 'prev') + fediloveData.meetAccountCurrentImg -= 1; + else if (direction === 'next') + fediloveData.meetAccountCurrentImg += 1; + const last = $('div.virtual-list > div.virtual-list-item').length - 1; + if (fediloveData.meetAccountCurrentImg > last) + fediloveData.meetAccountCurrentImg = last; + else if (fediloveData.meetAccountCurrentImg < 0) + fediloveData.meetAccountCurrentImg = 0; + + if (fediloveData.meetAccountCurrentImg === last) + document.querySelector('#meet-navigation > #profile-nav > #next').style = 'display: none'; + else if (fediloveData.meetAccountCurrentImg === 0) + document.querySelector('#meet-navigation > #profile-nav > #prev').style = 'display: none'; + else { + document.querySelector('#meet-navigation > #profile-nav > #next').style = ''; + document.querySelector('#meet-navigation > #profile-nav > #prev').style = ''; + } + }, meetPageGoToCurrentAccount: function(isRightSwipe) { isRightSwipe = isRightSwipe || false; const elements = $('div.virtual-list > div.virtual-list-item > article'); @@ -170,6 +190,7 @@ var fediloveFunctions = { }; var fediloveData = { chatAvatarCache: undefined, + meetAccountCurrentImg: 0, gotEmojifyTextFunction: false, composeTxtKeypressEvent: false }; @@ -381,6 +402,8 @@ function fedilove_customization() { document.querySelector('#meet-navigation > #profile-nav').style = ''; $('#meet-navigation > #anim-swipe').html(''); + // TO-DO: disable click events on every article + // prev and next navigation const cloneBackSvg = function(selector) { $(selector).html('');