Index: chrome/browser/resources/new_new_tab.js |
diff --git a/chrome/browser/resources/new_new_tab.js b/chrome/browser/resources/new_new_tab.js |
index b9404a670c000f6ad4b7b8c78b3d92e0e45fe041..c0f32bfa1dc006816abbd5af64522920124809d9 100644 |
--- a/chrome/browser/resources/new_new_tab.js |
+++ b/chrome/browser/resources/new_new_tab.js |
@@ -587,6 +587,9 @@ OptionMenu.prototype = { |
} |
}; |
+// TODO(aa): The 'clear-all-blacklisted' feature needs to move into a menu in |
+// the most visited section. |
+/* |
var optionMenu = new OptionMenu($('option-button'), $('option-menu')); |
optionMenu.commands = { |
'clear-all-blacklisted' : function() { |
@@ -604,10 +607,16 @@ optionMenu.commands = { |
saveShownSections(); |
} |
}; |
+*/ |
$('main').addEventListener('click', function(e) { |
- if (e.target.tagName == 'H2') { |
- var p = e.target.parentNode; |
+ var p = e.target; |
+ while (p && p.tagName != 'H2') { |
+ p = p.parentNode; |
+ } |
+ |
+ if (p) { |
+ p = p.parentNode; |
var section = p.getAttribute('section'); |
if (section) { |
if (shownSections & Section[section]) |
@@ -806,7 +815,8 @@ function callGetSyncMessageIfSyncIsPresent() { |
} |
function hideAllMenus() { |
- optionMenu.hide(); |
+ // TODO(aa): See comment in definition of optionMenu. |
+ //optionMenu.hide(); |
} |
window.addEventListener('blur', hideAllMenus); |