Change Android title *after* switching panges. Android ist faster.

This commit is contained in:
fkloft 2013-10-19 15:42:01 +02:00
parent a13c91dc82
commit fd90f44def

View File

@ -1,65 +1,66 @@
// created to start cleaning up "window" interaction // created to start cleaning up "window" interaction
// //
window.show = function(id) { window.show = function(id) {
if (typeof android !== 'undefined' && android && android.switchToPane) { /*
android.switchToPane(id); * disable all map properties when switching to another pane
} * because sometimes (bug?) touch events are passed to the map when
/* * other panes are focussed
* disable all map properties when switching to another pane */
* because sometimes (bug?) touch events are passed to the map when window.disableMapProperties();
* other panes are focussed window.hideall();
*/
window.disableMapProperties();
window.hideall();
switch(id) { switch(id) {
case 'full': case 'full':
window.chat.show('full'); window.chat.show('full');
break; break;
case 'compact': case 'compact':
window.chat.show('compact'); window.chat.show('compact');
break; break;
case 'public': case 'public':
window.chat.show('public'); window.chat.show('public');
break; break;
case 'faction': case 'faction':
window.chat.show('faction'); window.chat.show('faction');
break; break;
case 'debug': case 'debug':
window.debug.console.show(); window.debug.console.show();
break; break;
case 'map': case 'map':
window.enableMapProperties(); window.enableMapProperties();
window.smartphone.mapButton.click(); window.smartphone.mapButton.click();
$('#portal_highlight_select').show(); $('#portal_highlight_select').show();
$('#farm_level_select').show(); $('#farm_level_select').show();
break; break;
case 'info': case 'info':
window.smartphone.sideButton.click(); window.smartphone.sideButton.click();
break; break;
default: default:
window.smartphone.mapButton.click(); window.smartphone.mapButton.click();
break; break;
} }
if (typeof android !== 'undefined' && android && android.switchToPane) {
android.switchToPane(id);
}
} }
window.enableMapProperties = function() { window.enableMapProperties = function() {
window.map.tap.enable(); window.map.tap.enable();
window.map.dragging.enable(); window.map.dragging.enable();
window.map.touchZoom.enable(); window.map.touchZoom.enable();
window.map.doubleClickZoom.enable(); window.map.doubleClickZoom.enable();
} }
window.disableMapProperties = function() { window.disableMapProperties = function() {
window.map.tap.disable(); window.map.tap.disable();
window.map.dragging.disable(); window.map.dragging.disable();
window.map.touchZoom.disable(); window.map.touchZoom.disable();
window.map.doubleClickZoom.disable(); window.map.doubleClickZoom.disable();
} }
window.hideall = function() { window.hideall = function() {
$('#chatcontrols, #chat, #chatinput, #sidebartoggle, #scrollwrapper, #updatestatus, #portal_highlight_select').hide(); $('#chatcontrols, #chat, #chatinput, #sidebartoggle, #scrollwrapper, #updatestatus, #portal_highlight_select').hide();
$('#farm_level_select').hide(); $('#farm_level_select').hide();
$('#map').css('visibility', 'hidden'); $('#map').css('visibility', 'hidden');
$('.ui-tooltip').remove(); $('.ui-tooltip').remove();
} }