Chromium Code Reviews| Index: chrome/browser/resources/downloads/downloads.js |
| diff --git a/chrome/browser/resources/downloads/downloads.js b/chrome/browser/resources/downloads/downloads.js |
| index 75124aa47ab415e6fcd7675f7ce5306c2bccdac8..40ef566e13913a8759750257dd815cae54cb75e0 100644 |
| --- a/chrome/browser/resources/downloads/downloads.js |
| +++ b/chrome/browser/resources/downloads/downloads.js |
| @@ -52,15 +52,13 @@ function showInlineBlock(node, isShow) { |
| /** |
| * Creates a link with a specified onclick handler and content. |
| * @param {function()} onclick The onclick handler. |
| - * @param {string} value The link text. |
| + * @param {string=} opt_text The link text. |
| * @return {!Element} The created link element. |
| */ |
| -function createLink(onclick, value) { |
| - var link = document.createElement('a'); |
| +function createLink(onclick, opt_text) { |
|
aboxhall
2014/10/22 21:33:31
Perhaps this should be renamed createActionLink, t
Dan Beam
2014/10/23 03:05:44
Done.
|
| + var link = document.createElement('a', 'action-link'); |
| link.onclick = onclick; |
| - link.href = '#'; |
| - link.textContent = value; |
| - link.oncontextmenu = function() { return false; }; |
| + if (opt_text) link.textContent = opt_text; |
| return link; |
| } |
| @@ -330,7 +328,7 @@ function Download(download) { |
| this.nodeTitleArea_ = createElementWithClassName('div', 'title-area'); |
| this.safe_.appendChild(this.nodeTitleArea_); |
| - this.nodeFileLink_ = createLink(this.openFile_.bind(this), ''); |
| + this.nodeFileLink_ = createLink(this.openFile_.bind(this)); |
| this.nodeFileLink_.className = 'name'; |
| this.nodeFileLink_.style.display = 'none'; |
| this.nodeTitleArea_.appendChild(this.nodeFileLink_); |
| @@ -896,14 +894,10 @@ function load() { |
| clearAllHolder.hidden = true; |
| clearAllHolder.appendChild(clearAllElement); |
| - clearAllElement.oncontextmenu = function() { return false; }; |
| - // TODO(jhawkins): Use a link-button here. |
| - var openDownloadsFolderLink = $('open-downloads-folder'); |
| - openDownloadsFolderLink.onclick = function() { |
| + $('open-downloads-folder').onclick = function() { |
| chrome.send('openDownloadsFolder'); |
| }; |
| - openDownloadsFolderLink.oncontextmenu = function() { return false; }; |
| $('term').onsearch = function(e) { |
| setSearch($('term').value); |
| @@ -989,5 +983,3 @@ function tryDownloadUpdatedPeriodically() { |
| // Add handlers to HTML elements. |
| window.addEventListener('DOMContentLoaded', load); |
| - |
| -preventDefaultOnPoundLinkClicks(); // From util.js. |