| 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 // This Polymer element is used to show information about issues related | 5 // This Polymer element is used to show information about issues related |
| 6 // to casting. | 6 // to casting. |
| 7 Polymer({ | 7 Polymer({ |
| 8 is: 'issue-banner', | 8 is: 'issue-banner', |
| 9 | 9 |
| 10 properties: { | 10 properties: { |
| (...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 106 this.fireIssueActionClick_(this.issue.defaultActionType); | 106 this.fireIssueActionClick_(this.issue.defaultActionType); |
| 107 }, | 107 }, |
| 108 | 108 |
| 109 /** | 109 /** |
| 110 * Called when an optional issue action is clicked. | 110 * Called when an optional issue action is clicked. |
| 111 * | 111 * |
| 112 * @param {!Event} event The event object. | 112 * @param {!Event} event The event object. |
| 113 * @private | 113 * @private |
| 114 */ | 114 */ |
| 115 onClickOptAction_: function(event) { | 115 onClickOptAction_: function(event) { |
| 116 this.fireIssueActionClick_(this.issue.secondaryActionType); | 116 this.fireIssueActionClick_( |
| 117 /** @type {number} */(this.issue.secondaryActionType)); |
| 117 }, | 118 }, |
| 118 | 119 |
| 119 /** | 120 /** |
| 120 * Called when |issue| is updated. This updates the default and secondary | 121 * Called when |issue| is updated. This updates the default and secondary |
| 121 * action button text. | 122 * action button text. |
| 122 * | 123 * |
| 123 * @private | 124 * @private |
| 124 */ | 125 */ |
| 125 updateActionButtonText_: function() { | 126 updateActionButtonText_: function() { |
| 126 var defaultText = ''; | 127 var defaultText = ''; |
| 127 var secondaryText = ''; | 128 var secondaryText = ''; |
| 128 if (this.issue) { | 129 if (this.issue) { |
| 129 defaultText = loadTimeData.getString( | 130 defaultText = loadTimeData.getString( |
| 130 this.actionTypeToButtonTextResource_[ | 131 this.actionTypeToButtonTextResource_[ |
| 131 this.issue.defaultActionType]); | 132 this.issue.defaultActionType]); |
| 132 | 133 |
| 133 if (this.issue.secondaryActionType) { | 134 if (this.issue.secondaryActionType) { |
| 134 secondaryText = loadTimeData.getString( | 135 secondaryText = loadTimeData.getString( |
| 135 this.actionTypeToButtonTextResource_[ | 136 this.actionTypeToButtonTextResource_[ |
| 136 this.issue.secondaryActionType]); | 137 this.issue.secondaryActionType]); |
| 137 } | 138 } |
| 138 } | 139 } |
| 139 | 140 |
| 140 this.defaultActionButtonText_ = defaultText; | 141 this.defaultActionButtonText_ = defaultText; |
| 141 this.secondaryActionButtonText_ = secondaryText; | 142 this.secondaryActionButtonText_ = secondaryText; |
| 142 }, | 143 }, |
| 143 }); | 144 }); |
| OLD | NEW |