| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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: 'bookmarks-item', | 6 is: 'bookmarks-item', |
| 7 | 7 |
| 8 behaviors: [ | 8 behaviors: [ |
| 9 bookmarks.StoreClient, | 9 bookmarks.StoreClient, |
| 10 ], | 10 ], |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 this.dispatch(bookmarks.actions.selectItem( | 100 this.dispatch(bookmarks.actions.selectItem( |
| 101 this.itemId, e.ctrlKey, e.shiftKey, this.getState())); | 101 this.itemId, e.ctrlKey, e.shiftKey, this.getState())); |
| 102 e.stopPropagation(); | 102 e.stopPropagation(); |
| 103 }, | 103 }, |
| 104 | 104 |
| 105 /** | 105 /** |
| 106 * @param {Event} e | 106 * @param {Event} e |
| 107 * @private | 107 * @private |
| 108 */ | 108 */ |
| 109 onDblClick_: function(e) { | 109 onDblClick_: function(e) { |
| 110 if (!this.item_.url) | 110 if (!this.item_.url) { |
| 111 this.dispatch(bookmarks.actions.selectFolder(this.item_.id)); | 111 this.dispatch( |
| 112 else | 112 bookmarks.actions.selectFolder(this.item_.id, this.getState().nodes)); |
| 113 } else { |
| 113 chrome.tabs.create({url: this.item_.url}); | 114 chrome.tabs.create({url: this.item_.url}); |
| 115 } |
| 114 }, | 116 }, |
| 115 | 117 |
| 116 /** | 118 /** |
| 117 * @param {string} url | 119 * @param {string} url |
| 118 * @private | 120 * @private |
| 119 */ | 121 */ |
| 120 updateFavicon_: function(url) { | 122 updateFavicon_: function(url) { |
| 121 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); | 123 this.$.icon.style.backgroundImage = cr.icon.getFavicon(url); |
| 122 }, | 124 }, |
| 123 }); | 125 }); |
| OLD | NEW |