| 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() { | |
| 10 // isRTL() only works after i18n_template.js runs to set <html dir>. | |
| 11 this.overflowAlign_ = isRTL() ? 'left' : 'right'; | |
| 12 }, | |
| 13 | |
| 14 properties: { | 9 properties: { |
| 15 downloadsShowing: { | 10 downloadsShowing: { |
| 16 reflectToAttribute: true, | 11 reflectToAttribute: true, |
| 17 type: Boolean, | 12 type: Boolean, |
| 18 value: false, | 13 value: false, |
| 19 observer: 'downloadsShowingChanged_', | 14 observer: 'downloadsShowingChanged_', |
| 20 }, | 15 }, |
| 21 | |
| 22 overflowAlign_: { | |
| 23 type: String, | |
| 24 value: 'right', | |
| 25 }, | |
| 26 }, | 16 }, |
| 27 | 17 |
| 28 listeners: { | 18 listeners: { |
| 29 'paper-dropdown-close': 'onPaperDropdownClose_', | 19 'paper-dropdown-close': 'onPaperDropdownClose_', |
| 30 'paper-dropdown-open': 'onPaperDropdownOpen_', | 20 'paper-dropdown-open': 'onPaperDropdownOpen_', |
| 31 }, | 21 }, |
| 32 | 22 |
| 33 /** @return {boolean} Whether removal can be undone. */ | 23 /** @return {boolean} Whether removal can be undone. */ |
| 34 canUndo: function() { | 24 canUndo: function() { |
| 35 return this.$['search-input'] != this.shadowRoot.activeElement; | 25 return this.$['search-input'] != this.shadowRoot.activeElement; |
| (...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 | 92 |
| 103 /** @private */ | 93 /** @private */ |
| 104 updateClearAll_: function() { | 94 updateClearAll_: function() { |
| 105 this.$$('#actions .clear-all').hidden = !this.canClearAll(); | 95 this.$$('#actions .clear-all').hidden = !this.canClearAll(); |
| 106 this.$$('paper-menu .clear-all').hidden = !this.canClearAll(); | 96 this.$$('paper-menu .clear-all').hidden = !this.canClearAll(); |
| 107 }, | 97 }, |
| 108 }); | 98 }); |
| 109 | 99 |
| 110 return {Toolbar: Toolbar}; | 100 return {Toolbar: Toolbar}; |
| 111 }); | 101 }); |
| OLD | NEW |