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 6750 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6761 // Copyright 2016 The Chromium Authors. All rights reserved. | 6761 // Copyright 2016 The Chromium Authors. All rights reserved. |
6762 // Use of this source code is governed by a BSD-style license that can be | 6762 // Use of this source code is governed by a BSD-style license that can be |
6763 // found in the LICENSE file. | 6763 // found in the LICENSE file. |
6764 Polymer({ | 6764 Polymer({ |
6765 is: 'cr-toolbar', | 6765 is: 'cr-toolbar', |
6766 properties: { | 6766 properties: { |
6767 pageName: String, | 6767 pageName: String, |
6768 searchPrompt: String, | 6768 searchPrompt: String, |
6769 clearLabel: String, | 6769 clearLabel: String, |
6770 menuLabel: String, | 6770 menuLabel: String, |
6771 menuPromo: String, | |
6772 spinnerActive: Boolean, | 6771 spinnerActive: Boolean, |
6773 showMenu: { | 6772 showMenu: { |
6774 type: Boolean, | 6773 type: Boolean, |
6775 value: false | 6774 value: false |
6776 }, | 6775 }, |
6777 showMenuPromo: { | |
6778 type: Boolean, | |
6779 value: false | |
6780 }, | |
6781 closeMenuPromo: String, | |
6782 narrow_: { | 6776 narrow_: { |
6783 type: Boolean, | 6777 type: Boolean, |
6784 reflectToAttribute: true | 6778 reflectToAttribute: true |
6785 }, | 6779 }, |
6786 showingSearch_: { | 6780 showingSearch_: { |
6787 type: Boolean, | 6781 type: Boolean, |
6788 reflectToAttribute: true | 6782 reflectToAttribute: true |
6789 } | 6783 } |
6790 }, | 6784 }, |
6791 observers: [ 'possiblyShowMenuPromo_(showMenu, showMenuPromo, showingSearch_)'
], | |
6792 getSearchField: function() { | 6785 getSearchField: function() { |
6793 return this.$.search; | 6786 return this.$.search; |
6794 }, | 6787 }, |
6795 onClosePromoTap_: function() { | 6788 onMenuTap_: function(e) { |
6796 this.showMenuPromo = false; | |
6797 }, | |
6798 onMenuTap_: function() { | |
6799 this.fire('cr-menu-tap'); | 6789 this.fire('cr-menu-tap'); |
6800 this.onClosePromoTap_(); | |
6801 }, | |
6802 possiblyShowMenuPromo_: function() { | |
6803 Polymer.RenderStatus.afterNextRender(this, function() { | |
6804 if (this.showMenu && this.showMenuPromo && !this.showingSearch_) { | |
6805 this.$$('#menuPromo').animate({ | |
6806 opacity: [ 0, .9 ] | |
6807 }, { | |
6808 duration: 500, | |
6809 fill: 'forwards' | |
6810 }); | |
6811 this.fire('cr-menu-promo-shown'); | |
6812 } | |
6813 }.bind(this)); | |
6814 }, | |
6815 titleIfNotShowMenuPromo_: function(title, showMenuPromo) { | |
6816 return showMenuPromo ? '' : title; | |
6817 } | 6790 } |
6818 }); | 6791 }); |
6819 | 6792 |
6820 // Copyright 2015 The Chromium Authors. All rights reserved. | 6793 // Copyright 2015 The Chromium Authors. All rights reserved. |
6821 // Use of this source code is governed by a BSD-style license that can be | 6794 // Use of this source code is governed by a BSD-style license that can be |
6822 // found in the LICENSE file. | 6795 // found in the LICENSE file. |
6823 cr.define('downloads', function() { | 6796 cr.define('downloads', function() { |
6824 var Toolbar = Polymer({ | 6797 var Toolbar = Polymer({ |
6825 is: 'downloads-toolbar', | 6798 is: 'downloads-toolbar', |
6826 properties: { | 6799 properties: { |
(...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
7017 }; | 6990 }; |
7018 return { | 6991 return { |
7019 Manager: Manager | 6992 Manager: Manager |
7020 }; | 6993 }; |
7021 }); | 6994 }); |
7022 | 6995 |
7023 // Copyright 2015 The Chromium Authors. All rights reserved. | 6996 // Copyright 2015 The Chromium Authors. All rights reserved. |
7024 // Use of this source code is governed by a BSD-style license that can be | 6997 // Use of this source code is governed by a BSD-style license that can be |
7025 // found in the LICENSE file. | 6998 // found in the LICENSE file. |
7026 window.addEventListener('load', downloads.Manager.onLoad); | 6999 window.addEventListener('load', downloads.Manager.onLoad); |
OLD | NEW |