| Index: chrome/browser/resources/md_history/history_item.js
|
| diff --git a/chrome/browser/resources/md_history/history_item.js b/chrome/browser/resources/md_history/history_item.js
|
| index f7a1df3dd59f76b341ae5e8c82ae3216c9472a92..14f75068041ba263e5e3b995639c4fc215a74549 100644
|
| --- a/chrome/browser/resources/md_history/history_item.js
|
| +++ b/chrome/browser/resources/md_history/history_item.js
|
| @@ -168,25 +168,34 @@ cr.define('md_history', function() {
|
| },
|
|
|
| /**
|
| - * When a history-item is selected the toolbar is notified and increases
|
| - * or decreases its count of selected items accordingly.
|
| + * Toggle item selection whenever the checkbox or any non-interactive part
|
| + * of the item is clicked.
|
| * @param {MouseEvent} e
|
| * @private
|
| */
|
| - onCheckboxSelected_: function(e) {
|
| - // TODO(calamity): Fire this event whenever |selected| changes.
|
| + onItemClick_: function(e) {
|
| + for (var i = 0; i < e.path.length; i++) {
|
| + var elem = e.path[i];
|
| + if (elem.id != 'checkbox' &&
|
| + (elem.nodeName == 'A' || elem.nodeName == 'BUTTON')) {
|
| + return;
|
| + }
|
| + }
|
| +
|
| + if (this.selectionNotAllowed_())
|
| + return;
|
| +
|
| this.fire('history-checkbox-select', {
|
| element: this,
|
| shiftKey: e.shiftKey,
|
| });
|
| - e.preventDefault();
|
| },
|
|
|
| /**
|
| * @param {MouseEvent} e
|
| * @private
|
| */
|
| - onCheckboxMousedown_: function(e) {
|
| + onItemMousedown_: function(e) {
|
| // Prevent shift clicking a checkbox from selecting text.
|
| if (e.shiftKey)
|
| e.preventDefault();
|
|
|