Skip to content

Commit

Permalink
mobile .imgpreview: scroll to .fullimg on click
Browse files Browse the repository at this point in the history
  • Loading branch information
johndoe committed Jan 1, 2019
1 parent 2b37b00 commit f7be7e0
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions code/smartphone.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,16 @@ window.runOnSmartphonesAfterBoot = function() {
// init msg of status bar. hint for the user that a tap leads to the info screen
$('#mobileinfo').html('<div style="text-align: center"><b>tap here for info screen</b></div>');

// disable img full view
$('#portaldetails').off('click', '**');
// replace img full view handler
$('#portaldetails')
.off('click', '.imgpreview')
.on('click', '.imgpreview',function(e) {
if (e.currentTarget===e.target) { // do not fire on #level
$('.ui-tooltip').remove();
var offset = $('.fullimg').offset().top + $("#sidebar").scrollTop();
$("#sidebar").animate({ scrollTop: offset }, 200);
}
});

// make buttons in action bar flexible
var l = $('#chatcontrols a:visible');
Expand Down

0 comments on commit f7be7e0

Please sign in to comment.