| 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('downloads', function() { | 5 cr.define('downloads', function() { |
| 6 var Toolbar = Polymer({ | 6 var Toolbar = Polymer({ |
| 7 is: 'downloads-toolbar', | 7 is: 'downloads-toolbar', |
| 8 | 8 |
| 9 properties: { | 9 properties: { |
| 10 downloadsShowing: { | 10 downloadsShowing: { |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 80 this.boundClose_ = this.boundClose_ || this.closeMoreActions_.bind(this); | 80 this.boundClose_ = this.boundClose_ || this.closeMoreActions_.bind(this); |
| 81 window.addEventListener('resize', this.boundClose_); | 81 window.addEventListener('resize', this.boundClose_); |
| 82 }, | 82 }, |
| 83 | 83 |
| 84 /** | 84 /** |
| 85 * @param {!CustomEvent} event | 85 * @param {!CustomEvent} event |
| 86 * @private | 86 * @private |
| 87 */ | 87 */ |
| 88 onSearchChanged_: function(event) { | 88 onSearchChanged_: function(event) { |
| 89 var actionService = downloads.ActionService.getInstance(); | 89 var actionService = downloads.ActionService.getInstance(); |
| 90 actionService.search(/** @type {string} */ (event.detail)); | 90 if (actionService.search(/** @type {string} */ (event.detail))) |
| 91 this.spinnerActive = actionService.isSearching(); | 91 this.spinnerActive = actionService.isSearching(); |
| 92 this.updateClearAll_(); | 92 this.updateClearAll_(); |
| 93 }, | 93 }, |
| 94 | 94 |
| 95 /** @private */ | 95 /** @private */ |
| 96 onOpenDownloadsFolderTap_: function() { | 96 onOpenDownloadsFolderTap_: function() { |
| 97 downloads.ActionService.getInstance().openDownloadsFolder(); | 97 downloads.ActionService.getInstance().openDownloadsFolder(); |
| 98 }, | 98 }, |
| 99 | 99 |
| 100 /** @private */ | 100 /** @private */ |
| 101 updateClearAll_: function() { | 101 updateClearAll_: function() { |
| 102 this.$$('paper-menu .clear-all').hidden = !this.canClearAll(); | 102 this.$$('paper-menu .clear-all').hidden = !this.canClearAll(); |
| 103 }, | 103 }, |
| 104 }); | 104 }); |
| 105 | 105 |
| 106 return {Toolbar: Toolbar}; | 106 return {Toolbar: Toolbar}; |
| 107 }); | 107 }); |
| OLD | NEW |