Adding a back button when profiles are open.
This commit is contained in:
@@ -24,12 +24,12 @@ $(() => {
|
||||
};
|
||||
|
||||
// Handle clicks on profile links (by doing nothing)
|
||||
$('a.openlink').click(function(e) {
|
||||
$('a.openlink, a.closelink').click(function(e) {
|
||||
e.preventDefault();
|
||||
})
|
||||
|
||||
// Handle clicks on the banner
|
||||
$('div.banner').click(function() {
|
||||
$('div.banner, div#backbutton').click(function() {
|
||||
// If there's no person to open, do nothing
|
||||
if (typeof $(this).attr('data-person') == 'undefined') return;
|
||||
|
||||
@@ -134,6 +134,14 @@ $(() => {
|
||||
queue: true
|
||||
})
|
||||
|
||||
$('#backbutton').animate({
|
||||
top: '-3rem',
|
||||
right: '-3rem'
|
||||
}, {
|
||||
duration: 300
|
||||
})
|
||||
|
||||
|
||||
if (window.matchMedia('(orientation: portrait)').matches) {
|
||||
// If we're closing in portrait mode...
|
||||
$('.main.not' + p).css('width', '100vw')
|
||||
@@ -178,13 +186,19 @@ $(() => {
|
||||
}
|
||||
}
|
||||
|
||||
// Animate the display of links for a defined person
|
||||
// Animate the display of links for a defined person, and show the back button
|
||||
function animateLinks(p) {
|
||||
$('#links-' + p).animate({
|
||||
height: $('#links-' + p).get(0).scrollHeight
|
||||
}, {
|
||||
duration: 300,
|
||||
queue: true
|
||||
duration: 300
|
||||
})
|
||||
|
||||
$('#backbutton').animate({
|
||||
top: '2.5rem',
|
||||
right: '2.5rem'
|
||||
}, {
|
||||
duration: 300
|
||||
})
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user