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

Side by Side Diff: Source/devtools/front_end/ui/Tooltip.js

Issue 1300703004: DevTools: only set title w/ shortcut via Tooltip manager API. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined Created 5 years, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/devtools/front_end/ui/Toolbar.js ('k') | Source/devtools/front_end/ui/treeoutline.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 /** 5 /**
6 * @constructor 6 * @constructor
7 * @param {!Document} doc 7 * @param {!Document} doc
8 */ 8 */
9 WebInspector.Tooltip = function(doc) 9 WebInspector.Tooltip = function(doc)
10 { 10 {
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 new WebInspector.Tooltip(doc); 125 new WebInspector.Tooltip(doc);
126 } 126 }
127 127
128 /** 128 /**
129 * @param {!Element} element 129 * @param {!Element} element
130 * @param {!Element|string} tooltipContent 130 * @param {!Element|string} tooltipContent
131 * @param {string=} actionId 131 * @param {string=} actionId
132 */ 132 */
133 WebInspector.Tooltip.install = function(element, tooltipContent, actionId) 133 WebInspector.Tooltip.install = function(element, tooltipContent, actionId)
134 { 134 {
135 if (typeof tooltipContent === "string" && tooltipContent === "") 135 if (typeof tooltipContent === "string" && tooltipContent === "") {
136 delete element[WebInspector.Tooltip._symbol];
136 return; 137 return;
138 }
137 element[WebInspector.Tooltip._symbol] = { content: tooltipContent, actionId : actionId }; 139 element[WebInspector.Tooltip._symbol] = { content: tooltipContent, actionId : actionId };
138 } 140 }
141
142 Object.defineProperty(HTMLElement.prototype, "title", {
143 /**
144 * @return {!Element|string}
145 * @this {!Element}
146 */
147 get: function()
148 {
149 var tooltip = this[WebInspector.Tooltip._symbol];
150 return tooltip ? tooltip.content : "";
151 },
152
153 /**
154 * @param {!Element|string} x
155 * @this {!Element}
156 */
157 set: function(x)
158 {
159 WebInspector.Tooltip.install(this, x);
160 }
161 });
OLDNEW
« no previous file with comments | « Source/devtools/front_end/ui/Toolbar.js ('k') | Source/devtools/front_end/ui/treeoutline.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698