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

Unified Diff: chrome/browser/resources/options2/search_page.js

Issue 10408038: make the settings search page bubbles look cool (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 8 years, 7 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/options2/search_page.css ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/options2/search_page.js
diff --git a/chrome/browser/resources/options2/search_page.js b/chrome/browser/resources/options2/search_page.js
index 8599fd5e9839ade2c6390945a424cfc0de219b20..e4a0c617ad1819c7fda6116ffa85c640db74b3c6 100644
--- a/chrome/browser/resources/options2/search_page.js
+++ b/chrome/browser/resources/options2/search_page.js
@@ -12,7 +12,7 @@ cr.define('options', function() {
function SearchBubble(text) {
var el = cr.doc.createElement('div');
SearchBubble.decorate(el);
- el.textContent = text;
+ el.content = text;
return el;
}
@@ -27,6 +27,10 @@ cr.define('options', function() {
decorate: function() {
this.className = 'search-bubble';
+ this.innards_ = cr.doc.createElement('div');
+ this.innards_.className = 'search-bubble-innards';
+ this.appendChild(this.innards_);
+
// We create a timer to periodically update the position of the bubbles.
// While this isn't all that desirable, it's the only sure-fire way of
// making sure the bubbles stay in the correct location as sections
@@ -34,9 +38,17 @@ cr.define('options', function() {
this.intervalId = setInterval(this.updatePosition.bind(this), 250);
},
- /**
- * Attach the bubble to the element.
- */
+ /**
+ * Sets the text message in the bubble.
+ * @param {string} text The text the bubble will show.
+ */
+ set content(text) {
+ this.innards_.textContent = text;
+ },
+
+ /**
+ * Attach the bubble to the element.
+ */
attachTo: function(element) {
var parent = element.parentElement;
if (!parent)
« no previous file with comments | « chrome/browser/resources/options2/search_page.css ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698