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

Unified Diff: chrome/browser/resources/history.js

Issue 8598017: History/Downloads: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: csilv@'s code review changes Created 9 years, 1 month 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/history.html ('k') | chrome/browser/resources/shared/css/button.css » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/history.js
diff --git a/chrome/browser/resources/history.js b/chrome/browser/resources/history.js
index 2c70f571f58bd1c48bf27411e1a0344157c69103..885619e08c3e227e71ee573e32d8cf0a3a4ed4ca 100644
--- a/chrome/browser/resources/history.js
+++ b/chrome/browser/resources/history.js
@@ -103,7 +103,7 @@ function Page(result, continued, model, id) {
Page.prototype.getResultDOM = function(searchResultFlag) {
var node = createElementWithClassName('li', 'entry');
var time = createElementWithClassName('div', 'time');
- var entryBox = createElementWithClassName('label', 'entry-box');
+ var entryBox = createElementWithClassName('div', 'entry-box');
var domain = createElementWithClassName('div', 'domain');
var dropDown = createElementWithClassName('button', 'drop-down');
@@ -135,15 +135,18 @@ Page.prototype.getResultDOM = function(searchResultFlag) {
domain.textContent = this.domain_;
// Clicking anywhere in the entryBox will check/uncheck the checkbox.
- entryBox.setAttribute('for', checkbox.id);
entryBox.addEventListener('mousedown', entryBoxMousedown, false);
// Prevent clicks on the drop down from affecting the checkbox.
dropDown.addEventListener('click', function(e) { e.preventDefault(); });
+ // A label around the parts that should be clicked to activate the check box.
+ var label = document.createElement('label');
+ label.appendChild(time);
+ label.appendChild(domain);
+
// We use a wrapper div so that the entry contents will be shinkwrapped.
- entryBox.appendChild(time);
- entryBox.appendChild(domain);
+ entryBox.appendChild(label);
entryBox.appendChild(this.getTitleDOM_());
entryBox.appendChild(dropDown);
@@ -981,7 +984,7 @@ function removeItems() {
urls = [];
date = cbDate;
}
- var link = checkbox.parentNode.parentNode.querySelector('a');
+ var link = checkbox.parentNode.parentNode.parentNode.querySelector('a');
checkbox.disabled = true;
link.classList.add('to-be-removed');
disabledItems.push(checkbox);
@@ -1003,7 +1006,7 @@ function removeItems() {
// enabled, non-line-through state.
for (var i = 0; i < disabledItems.length; i++) {
var checkbox = disabledItems[i];
- var link = checkbox.parentNode.parentNode.querySelector('a');
+ var link = checkbox.parentNode.parentNode.parentNode.querySelector('a');
checkbox.disabled = false;
link.classList.remove('to-be-removed');
}
« no previous file with comments | « chrome/browser/resources/history.html ('k') | chrome/browser/resources/shared/css/button.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698