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

Unified Diff: chrome/browser/resources/contextual_search/promo.js

Issue 982643002: [Contextual Search] Update promo look. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actually adding SVG ;) Created 5 years, 9 months 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
« no previous file with comments | « chrome/browser/resources/contextual_search/promo.html ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/contextual_search/promo.js
diff --git a/chrome/browser/resources/contextual_search/promo.js b/chrome/browser/resources/contextual_search/promo.js
index 85c51c132b44e513eb83f248d9b08591fafce7c4..8e17d909aeaecacca5bab9ebfd93017d60a204dd 100644
--- a/chrome/browser/resources/contextual_search/promo.js
+++ b/chrome/browser/resources/contextual_search/promo.js
@@ -21,7 +21,7 @@ var OPT_IN_DELAY_MS = 65;
*/
document.addEventListener('DOMContentLoaded', function(event) {
if (config['hideHeader']) {
- $('container').removeChild($('header-image'));
+ removeHeaderImages();
}
$('optin-button').addEventListener('click', function() {
$('container').classList.add('hide');
@@ -42,3 +42,17 @@ document.addEventListener('DOMContentLoaded', function(event) {
function getContentHeight() {
return $('container').clientHeight;
}
+
+/**
+ * Removes all header images from the promo.
+ */
+function removeHeaderImages() {
+ var images = document.querySelectorAll('.header-image');
+ for (var i = 0, length = images.length; i < length; i++) {
+ var image = images[i];
+ var parent = image.parentElement;
+ if (parent) {
+ parent.removeChild(image);
+ }
+ }
+}
« no previous file with comments | « chrome/browser/resources/contextual_search/promo.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698