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