| 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 Polymer({ | 5 Polymer({ |
| 6 is: 'history-item', | 6 is: 'history-item', |
| 7 | 7 |
| 8 properties: { | 8 properties: { |
| 9 // The date of these history items. | 9 // The date of these history items. |
| 10 historyDate: { | 10 historyDate: { |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 countAddition: this.$.checkbox.checked ? 1 : -1 | 87 countAddition: this.$.checkbox.checked ? 1 : -1 |
| 88 }); | 88 }); |
| 89 }, | 89 }, |
| 90 | 90 |
| 91 /** | 91 /** |
| 92 * When the url for the history-item is set, the icon associated with this | 92 * When the url for the history-item is set, the icon associated with this |
| 93 * website is also set. | 93 * website is also set. |
| 94 * @private | 94 * @private |
| 95 */ | 95 */ |
| 96 showIcon_: function() { | 96 showIcon_: function() { |
| 97 this.$['website-icon'].style.backgroundImage = | 97 this.$.icon.style.backgroundImage = |
| 98 getFaviconImageSet(this.websiteUrl); | 98 getFaviconImageSet(this.websiteUrl); |
| 99 }, | 99 }, |
| 100 | 100 |
| 101 /** | 101 /** |
| 102 * Fires a custom event when the menu button is clicked. Sends the details of | 102 * Fires a custom event when the menu button is clicked. Sends the details of |
| 103 * the history item and where the menu should appear. | 103 * the history item and where the menu should appear. |
| 104 */ | 104 */ |
| 105 onMenuButtonTap_: function(e) { | 105 onMenuButtonTap_: function(e) { |
| 106 var position = this.$['menu-button'].getBoundingClientRect(); | 106 var position = this.$['menu-button'].getBoundingClientRect(); |
| 107 | 107 |
| 108 this.fire('toggle-menu', { | 108 this.fire('toggle-menu', { |
| 109 x: position.left, | 109 x: position.left, |
| 110 y: position.top, | 110 y: position.top, |
| 111 accessTime: this.timestamp | 111 accessTime: this.timestamp |
| 112 }); | 112 }); |
| 113 | 113 |
| 114 // Stops the 'tap' event from closing the menu when it opens. | 114 // Stops the 'tap' event from closing the menu when it opens. |
| 115 e.stopPropagation(); | 115 e.stopPropagation(); |
| 116 }, | 116 }, |
| 117 | 117 |
| 118 selectionNotAllowed_: function() { | 118 selectionNotAllowed_: function() { |
| 119 return !loadTimeData.getBoolean('allowDeletingHistory'); | 119 return !loadTimeData.getBoolean('allowDeletingHistory'); |
| 120 } | 120 } |
| 121 }); | 121 }); |
| OLD | NEW |