| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 function assert(condition, opt_message) { | 4 function assert(condition, opt_message) { |
| 5 if (!condition) { | 5 if (!condition) { |
| 6 var message = 'Assertion failed'; | 6 var message = 'Assertion failed'; |
| 7 if (opt_message) message = message + ': ' + opt_message; | 7 if (opt_message) message = message + ': ' + opt_message; |
| 8 var error = new Error(message); | 8 var error = new Error(message); |
| 9 var global = function() { | 9 var global = function() { |
| 10 return this; | 10 return this; |
| (...skipping 6661 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6672 narrow: { | 6672 narrow: { |
| 6673 type: Boolean, | 6673 type: Boolean, |
| 6674 reflectToAttribute: true | 6674 reflectToAttribute: true |
| 6675 }, | 6675 }, |
| 6676 label: String, | 6676 label: String, |
| 6677 clearLabel: String, | 6677 clearLabel: String, |
| 6678 spinnerActive: { | 6678 spinnerActive: { |
| 6679 type: Boolean, | 6679 type: Boolean, |
| 6680 reflectToAttribute: true | 6680 reflectToAttribute: true |
| 6681 }, | 6681 }, |
| 6682 hasSearchText_: Boolean | 6682 hasSearchText_: Boolean, |
| 6683 isSpinnerShown_: { |
| 6684 type: Boolean, |
| 6685 computed: 'computeIsSpinnerShown_(spinnerActive, showingSearch)' |
| 6686 } |
| 6683 }, | 6687 }, |
| 6684 listeners: { | 6688 listeners: { |
| 6685 tap: 'showSearch_', | 6689 tap: 'showSearch_', |
| 6686 'searchInput.bind-value-changed': 'onBindValueChanged_' | 6690 'searchInput.bind-value-changed': 'onBindValueChanged_' |
| 6687 }, | 6691 }, |
| 6688 getSearchInput: function() { | 6692 getSearchInput: function() { |
| 6689 return this.$.searchInput; | 6693 return this.$.searchInput; |
| 6690 }, | 6694 }, |
| 6691 isSearchFocused: function() { | 6695 isSearchFocused: function() { |
| 6692 return this.$.searchTerm.focused; | 6696 return this.$.searchTerm.focused; |
| 6693 }, | 6697 }, |
| 6694 computeIconTabIndex_: function(narrow) { | 6698 computeIconTabIndex_: function(narrow) { |
| 6695 return narrow ? 0 : -1; | 6699 return narrow ? 0 : -1; |
| 6696 }, | 6700 }, |
| 6697 isSpinnerShown_: function(spinnerActive, showingSearch) { | 6701 computeIsSpinnerShown_: function() { |
| 6698 return spinnerActive && showingSearch; | 6702 return this.spinnerActive && this.showingSearch; |
| 6699 }, | 6703 }, |
| 6700 onInputBlur_: function() { | 6704 onInputBlur_: function() { |
| 6701 if (!this.hasSearchText_) this.showingSearch = false; | 6705 if (!this.hasSearchText_) this.showingSearch = false; |
| 6702 }, | 6706 }, |
| 6703 onBindValueChanged_: function() { | 6707 onBindValueChanged_: function() { |
| 6704 var newValue = this.$.searchInput.bindValue; | 6708 var newValue = this.$.searchInput.bindValue; |
| 6705 this.hasSearchText_ = newValue != ''; | 6709 this.hasSearchText_ = newValue != ''; |
| 6706 if (newValue != '') this.showingSearch = true; | 6710 if (newValue != '') this.showingSearch = true; |
| 6707 }, | 6711 }, |
| 6708 showSearch_: function(e) { | 6712 showSearch_: function(e) { |
| (...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6940 }; | 6944 }; |
| 6941 return { | 6945 return { |
| 6942 Manager: Manager | 6946 Manager: Manager |
| 6943 }; | 6947 }; |
| 6944 }); | 6948 }); |
| 6945 | 6949 |
| 6946 // Copyright 2015 The Chromium Authors. All rights reserved. | 6950 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 6947 // Use of this source code is governed by a BSD-style license that can be | 6951 // Use of this source code is governed by a BSD-style license that can be |
| 6948 // found in the LICENSE file. | 6952 // found in the LICENSE file. |
| 6949 window.addEventListener('load', downloads.Manager.onLoad); | 6953 window.addEventListener('load', downloads.Manager.onLoad); |
| OLD | NEW |