| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 cr.define('md_history', function() { | 5 cr.define('md_history', function() { |
| 6 var HistoryItem = Polymer({ | 6 var HistoryItem = Polymer({ |
| 7 is: 'history-item', | 7 is: 'history-item', |
| 8 | 8 |
| 9 properties: { | 9 properties: { |
| 10 // Underlying HistoryEntry data for this item. Contains read-only fields | 10 // Underlying HistoryEntry data for this item. Contains read-only fields |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 isCardStart: {type: Boolean, reflectToAttribute: true}, | 24 isCardStart: {type: Boolean, reflectToAttribute: true}, |
| 25 | 25 |
| 26 isCardEnd: {type: Boolean, reflectToAttribute: true}, | 26 isCardEnd: {type: Boolean, reflectToAttribute: true}, |
| 27 | 27 |
| 28 // True if the item is being displayed embedded in another element and | 28 // True if the item is being displayed embedded in another element and |
| 29 // should not manage its own borders or size. | 29 // should not manage its own borders or size. |
| 30 embedded: {type: Boolean, reflectToAttribute: true}, | 30 embedded: {type: Boolean, reflectToAttribute: true}, |
| 31 | 31 |
| 32 hasTimeGap: {type: Boolean}, | 32 hasTimeGap: {type: Boolean}, |
| 33 | 33 |
| 34 numberOfItems: {type: Number} | 34 numberOfItems: {type: Number}, |
| 35 |
| 36 // The path of this history item inside its parent. |
| 37 path: String, |
| 35 }, | 38 }, |
| 36 | 39 |
| 37 /** | 40 /** |
| 38 * When a history-item is selected the toolbar is notified and increases | 41 * When a history-item is selected the toolbar is notified and increases |
| 39 * or decreases its count of selected items accordingly. | 42 * or decreases its count of selected items accordingly. |
| 40 * @private | 43 * @private |
| 41 */ | 44 */ |
| 42 onCheckboxSelected_: function() { | 45 onCheckboxSelected_: function() { |
| 46 // TODO(calamity): Fire this event whenever |selected| changes. |
| 43 this.fire('history-checkbox-select', { | 47 this.fire('history-checkbox-select', { |
| 48 element: this, |
| 44 countAddition: this.$.checkbox.checked ? 1 : -1 | 49 countAddition: this.$.checkbox.checked ? 1 : -1 |
| 45 }); | 50 }); |
| 46 }, | 51 }, |
| 47 | 52 |
| 48 /** | 53 /** |
| 49 * Remove bookmark of current item when bookmark-star is clicked. | 54 * Remove bookmark of current item when bookmark-star is clicked. |
| 50 * @private | 55 * @private |
| 51 */ | 56 */ |
| 52 onRemoveBookmarkTap_: function() { | 57 onRemoveBookmarkTap_: function() { |
| 53 if (this.$['bookmark-star'] == this.root.activeElement) | 58 if (this.$['bookmark-star'] == this.root.activeElement) |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 | 136 |
| 132 if (searchedTerm) | 137 if (searchedTerm) |
| 133 return currentItem.dateShort != nextItem.dateShort; | 138 return currentItem.dateShort != nextItem.dateShort; |
| 134 | 139 |
| 135 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && | 140 return currentItem.time - nextItem.time > BROWSING_GAP_TIME && |
| 136 currentItem.dateRelativeDay == nextItem.dateRelativeDay; | 141 currentItem.dateRelativeDay == nextItem.dateRelativeDay; |
| 137 }; | 142 }; |
| 138 | 143 |
| 139 return { HistoryItem: HistoryItem }; | 144 return { HistoryItem: HistoryItem }; |
| 140 }); | 145 }); |
| OLD | NEW |