| 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 attached: function() { | 9 attached: function() { |
| 10 // isRTL() only works after i18n_template.js runs to set <html dir>. |
| 11 this.overflowAlign_ = isRTL() ? 'left' : 'right'; |
| 12 |
| 10 /** @private {!SearchFieldDelegate} */ | 13 /** @private {!SearchFieldDelegate} */ |
| 11 this.searchFieldDelegate_ = new ToolbarSearchFieldDelegate(this); | 14 this.searchFieldDelegate_ = new ToolbarSearchFieldDelegate(this); |
| 12 this.$['search-input'].setDelegate(this.searchFieldDelegate_); | 15 this.$['search-input'].setDelegate(this.searchFieldDelegate_); |
| 13 }, | 16 }, |
| 14 | 17 |
| 15 properties: { | 18 properties: { |
| 16 downloadsShowing: { | 19 downloadsShowing: { |
| 17 reflectToAttribute: true, | 20 reflectToAttribute: true, |
| 18 type: Boolean, | 21 type: Boolean, |
| 19 value: false, | 22 value: false, |
| 20 observer: 'onDownloadsShowingChange_', | 23 observer: 'onDownloadsShowingChange_', |
| 21 }, | 24 }, |
| 25 |
| 26 overflowAlign_: { |
| 27 type: String, |
| 28 value: 'right', |
| 29 }, |
| 22 }, | 30 }, |
| 23 | 31 |
| 24 /** @return {boolean} Whether removal can be undone. */ | 32 /** @return {boolean} Whether removal can be undone. */ |
| 25 canUndo: function() { | 33 canUndo: function() { |
| 26 return this.$['search-input'] != this.shadowRoot.activeElement; | 34 return this.$['search-input'] != this.shadowRoot.activeElement; |
| 27 }, | 35 }, |
| 28 | 36 |
| 29 /** @return {boolean} Whether "Clear all" should be allowed. */ | 37 /** @return {boolean} Whether "Clear all" should be allowed. */ |
| 30 canClearAll: function() { | 38 canClearAll: function() { |
| 31 return !this.$['search-input'].getValue() && this.downloadsShowing; | 39 return !this.$['search-input'].getValue() && this.downloadsShowing; |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 }; | 87 }; |
| 80 | 88 |
| 81 return {Toolbar: Toolbar}; | 89 return {Toolbar: Toolbar}; |
| 82 }); | 90 }); |
| 83 | 91 |
| 84 // TODO(dbeam): https://github.com/PolymerElements/iron-dropdown/pull/16/files | 92 // TODO(dbeam): https://github.com/PolymerElements/iron-dropdown/pull/16/files |
| 85 /** @suppress {checkTypes} */ | 93 /** @suppress {checkTypes} */ |
| 86 (function() { | 94 (function() { |
| 87 Polymer.IronDropdownScrollManager.pushScrollLock = function() {}; | 95 Polymer.IronDropdownScrollManager.pushScrollLock = function() {}; |
| 88 })(); | 96 })(); |
| OLD | NEW |