From 0d177c0b2386a1dea6249157df81fce6c71758ac Mon Sep 17 00:00:00 2001 From: "aa@chromium.org" Date: Wed, 5 May 2010 18:47:30 +0000 Subject: Tell the app launcher about any newly installed apps. This is intended to be used for a nice animation. Review URL: http://codereview.chromium.org/1906004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46472 0039d316-1c4b-4281-b951-d872f2087c98 --- chrome/browser/resources/new_new_tab.css | 2 +- chrome/browser/resources/new_new_tab.html | 23 +++++++++++++++++++++-- 2 files changed, 22 insertions(+), 3 deletions(-) (limited to 'chrome/browser/resources') diff --git a/chrome/browser/resources/new_new_tab.css b/chrome/browser/resources/new_new_tab.css index 43099a13..69409f2 100644 --- a/chrome/browser/resources/new_new_tab.css +++ b/chrome/browser/resources/new_new_tab.css @@ -16,7 +16,7 @@ body { min-height: 100%; } -html[hash=app-launcher] #container { +html[mode=app-launcher] #container { min-height: 0; } diff --git a/chrome/browser/resources/new_new_tab.html b/chrome/browser/resources/new_new_tab.html index a10b238..47bc25b 100644 --- a/chrome/browser/resources/new_new_tab.html +++ b/chrome/browser/resources/new_new_tab.html @@ -96,8 +96,27 @@ function updateSimpleSection(id, section) { document.getElementById(id).className += ' hidden'; } -// Reflect the hash as an attribute so we can use CSS attribute selectors on it. -document.documentElement.setAttribute('hash', location.hash.slice(1)); +// Parse any name value pairs passed through the URL hash. +var hashParams = (function() { + var result = {}; + if (location.hash.length) { + location.hash.substr(1).split('&').forEach(function(pair) { + pair = pair.split('='); + if (pair.length != 2) { + throw new Error('Unexpected hash value: ' + location.hash); + } + + result[pair[0]] = pair[1]; + }); + } + return result; +})(); + +// Reflect the mode param as an attribute so we can use CSS attribute selectors +// on it. +if ('mode' in hashParams) { + document.documentElement.setAttribute('mode', hashParams['mode']); +} -- cgit v1.1