From c404564277fa3cd5713efa6966287c072b489a87 Mon Sep 17 00:00:00 2001 From: "jamiewalch@google.com" Date: Wed, 14 Sep 2011 23:39:12 +0000 Subject: Centre tool-bar manually to ignore vertical scroll-bar. BUG=96286 TEST=Manual Review URL: http://codereview.chromium.org/7889043 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@101190 0039d316-1c4b-4281-b951-d872f2087c98 --- remoting/webapp/me2mom/remoting.js | 11 ++++++++++- remoting/webapp/me2mom/toolbar.css | 2 -- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'remoting') diff --git a/remoting/webapp/me2mom/remoting.js b/remoting/webapp/me2mom/remoting.js index 6e64d30..9e4f9b8 100644 --- a/remoting/webapp/me2mom/remoting.js +++ b/remoting/webapp/me2mom/remoting.js @@ -465,8 +465,9 @@ function onClientStateChange_(oldState) { } else if (state == remoting.ClientSession.State.INITIALIZING) { remoting.debug.log('Initializing connection'); } else if (state == remoting.ClientSession.State.CONNECTED) { - showToolbarPreview_(); remoting.setMode(remoting.AppMode.IN_SESSION); + recenterToolbar_(); + showToolbarPreview_(); updateStatistics(); var accessCode = document.getElementById('access-code-entry'); accessCode.value = ''; @@ -674,6 +675,7 @@ remoting.toggleScaleToFit = function(button) { remoting.onResize = function() { if (remoting.session) remoting.session.onWindowSizeChanged(); + recenterToolbar_(); } /** @@ -724,4 +726,11 @@ remoting.setUseP2pApi = function(use) { } } +function recenterToolbar_() { + var toolbar = document.getElementById('session-toolbar'); + var toolbarX = (window.innerWidth - toolbar.clientWidth) / 2; + toolbar.style['left'] = toolbarX + 'px'; + remoting.debug.log('toolbar moved to ' + toolbarX); +} + }()); diff --git a/remoting/webapp/me2mom/toolbar.css b/remoting/webapp/me2mom/toolbar.css index 0b67cbf..a89b243 100644 --- a/remoting/webapp/me2mom/toolbar.css +++ b/remoting/webapp/me2mom/toolbar.css @@ -7,8 +7,6 @@ position: fixed; top: -45px; width: 640px; - left: 50%; - margin-left: -320px; -webkit-transition: top 0.2s linear; -webkit-transition-delay: 0.7s; font-size: 13px; -- cgit v1.1