Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2526)

Unified Diff: chrome/browser/resources/aura/app_list/app_list.js

Issue 8747021: [Aura] Polish app list. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix comments in #3 Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/aura/app_list/app_list.js
diff --git a/chrome/browser/resources/aura/app_list/app_list.js b/chrome/browser/resources/aura/app_list/app_list.js
index 5d20e9c5913e441c484ab6d8d71cb5ec23a63095..e2f5f31e069d9b6d33fa1f6cca6bac81c0a9aec1 100644
--- a/chrome/browser/resources/aura/app_list/app_list.js
+++ b/chrome/browser/resources/aura/app_list/app_list.js
@@ -23,6 +23,21 @@ cr.define('appList', function() {
*/
function load() {
appsView = new appList.AppsView();
+
+ document.addEventListener('click', onDocClick);
+ }
+
+ /**
+ * Document click event handler.
+ */
+ function onDocClick(e) {
+ // Close if click is on body, or not on app, paging dot or its children.
+ if (e.target == document.body ||
+ (!e.target.classList.contains('app') &&
+ !e.target.classList.contains('dot') &&
+ !(e.target.parent && e.target.parent.classList.contains('dot')))) {
Evan Stade 2011/12/02 20:40:06 findAncestorByClassName
xiyuan 2011/12/02 21:24:20 Done.
+ chrome.send('close');
+ }
}
/**
@@ -46,6 +61,7 @@ cr.define('appList', function() {
function getAppsCallback(data) {
appsView.getAppsCallback(data);
+ chrome.send('onAppsLoaded');
}
function getAppsPageIndex(page) {
« no previous file with comments | « chrome/browser/resources/aura/app_list/app_list.html ('k') | chrome/browser/ui/views/aura/app_list_window.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698