From 513382f83573dc0e59d77c38594001658b3315aa Mon Sep 17 00:00:00 2001 From: Bryan Housel Date: Thu, 19 Jan 2017 19:09:33 +0530 Subject: [PATCH] Only show splash and history restore prompts the first time --- modules/ui/init.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/modules/ui/init.js b/modules/ui/init.js index 39e8fa15d..2ef03a3b9 100644 --- a/modules/ui/init.js +++ b/modules/ui/init.js @@ -32,10 +32,15 @@ import { uiUndoRedo } from './undo_redo'; import { uiZoom } from './zoom'; import { uiCmd } from './cmd'; +var uiInitCounter = 0; + export function uiInit(context) { function render(container) { + container + .attr('dir', textDirection); + var map = context.map(); var hash = behaviorHash(context); @@ -68,13 +73,9 @@ export function uiInit(context) { content .append('div') .attr('id', 'map') - .attr('dir', 'ltr') + // .attr('dir', 'ltr') .call(map); - if (textDirection === 'rtl') { - d3.select('body').attr('dir', 'rtl'); - } - content .call(uiMapInMap(context)); @@ -268,9 +269,11 @@ export function uiInit(context) { context.enter(modeBrowse(context)); - context.container() - .call(uiSplash(context)) - .call(uiRestore(context)); + if (!uiInitCounter++) { + context.container() + .call(uiSplash(context)) + .call(uiRestore(context)); + } var authenticating = uiLoading(context) .message(t('loading_auth')) @@ -284,6 +287,8 @@ export function uiInit(context) { .on('authDone.ui', function() { authenticating.close(); }); + + uiInitCounter++; } @@ -316,6 +321,7 @@ export function uiInit(context) { }); }; + window.restart = ui.restart; ui.sidebar = uiSidebar(context);