Implemented account images indexes controlling on fedilove.js
This commit is contained in:
parent
276c6e3b6e
commit
d46cf454b3
|
@ -7,8 +7,8 @@
|
|||
</a>
|
||||
<div id="anim-swipe" onclick="return window.fediloveUI.meetPageGoToCurrentAccount();"></div>
|
||||
<div id="profile-nav" style="display: none">
|
||||
<div id="prev"></div>
|
||||
<div id="next"></div>
|
||||
<div id="prev" style="display: none" onclick="return window.fediloveUI.meetAccountImageDirection('prev')"></div>
|
||||
<div id="next" onclick="return window.fediloveUI.meetAccountImageDirection('next')"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -311,6 +311,7 @@ div.main-content.account {
|
|||
margin: auto;
|
||||
|
||||
article.status-article {
|
||||
cursor: initial !important;
|
||||
background: none !important;
|
||||
padding: 0;
|
||||
|
||||
|
|
|
@ -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('');
|
||||
|
|
Loading…
Reference in New Issue