Improved back handling in mobile app. Now more consistant with standard.

This commit is contained in:
hastarin
2013-05-25 11:58:35 +10:00
parent 27cb2efde5
commit 3691402e4a
4 changed files with 93 additions and 43 deletions

View File

@ -81,20 +81,7 @@ window.runOnSmartphonesAfterBoot = function() {
var l = $('#chatcontrols a:visible');
l.css('width', 100/l.length + '%');
// add event to portals that allows long press to switch to sidebar
window.addHook('portalAdded', function(data) {
data.portal.on('add', function() {
if(!this._container || this.options.addedTapHoldHandler) return;
this.options.addedTapHoldHandler = true;
var guid = this.options.guid;
// this is a hack, accessing Leaflets private _container is evil
$(this._container).on('taphold', function() {
window.renderPortalDetails(guid);
window.smartphone.sideButton.click();
});
});
});
// NOTE: Removed long press hook as it would break new back stack handling
// Force lower render limits for mobile
window.VIEWPORT_PAD_RATIO = 0.1;