Skip to content

Commit

Permalink
Merge pull request #42 from johnd0e/fix-mobile-imgpreview-click
Browse files Browse the repository at this point in the history
scroll to .fullimg on click @ .imgpreview [mobile]
  • Loading branch information
modos189 authored Jan 3, 2019
2 parents 4faf94c + 96636fb commit e3e7051
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 @@ -142,8 +142,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
$('div[class=imgpreview]').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 newTop = $('.fullimg').position().top + $("#sidebar").scrollTop();
$("#sidebar").animate({ scrollTop: newTop }, 200);
}
});

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

0 comments on commit e3e7051

Please sign in to comment.