| 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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 return issue.isBlocking ? 'blocking' : 'non-blocking'; | 74 return issue.isBlocking ? 'blocking' : 'non-blocking'; |
| 75 }, | 75 }, |
| 76 | 76 |
| 77 /** | 77 /** |
| 78 * @param {?media_router.Issue} issue | 78 * @param {?media_router.Issue} issue |
| 79 * @return {boolean} Whether or not to hide the non-blocking issue UI. | 79 * @return {boolean} Whether or not to hide the non-blocking issue UI. |
| 80 * @private | 80 * @private |
| 81 */ | 81 */ |
| 82 computeOptionalActionHidden_: function(issue) { | 82 computeOptionalActionHidden_: function(issue) { |
| 83 return !issue || !issue.secondaryActionType; | 83 return !issue || issue.secondaryActionType === undefined; |
| 84 }, | 84 }, |
| 85 | 85 |
| 86 /** | 86 /** |
| 87 * Fires an issue-action-click event. | 87 * Fires an issue-action-click event. |
| 88 * | 88 * |
| 89 * @param {number} actionType The type of issue action. | 89 * @param {number} actionType The type of issue action. |
| 90 * @private | 90 * @private |
| 91 */ | 91 */ |
| 92 fireIssueActionClick_: function(actionType) { | 92 fireIssueActionClick_: function(actionType) { |
| 93 this.fire('issue-action-click', { | 93 this.fire('issue-action-click', { |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 = |
| 132 this.i18n(this.actionTypeToButtonTextResource_[ | 132 this.i18n(this.actionTypeToButtonTextResource_[ |
| 133 this.issue.defaultActionType]); | 133 this.issue.defaultActionType]); |
| 134 | 134 |
| 135 if (this.issue.secondaryActionType) { | 135 if (this.issue.secondaryActionType !== undefined) { |
| 136 secondaryText = | 136 secondaryText = |
| 137 this.i18n(this.actionTypeToButtonTextResource_[ | 137 this.i18n(this.actionTypeToButtonTextResource_[ |
| 138 this.issue.secondaryActionType]); | 138 this.issue.secondaryActionType]); |
| 139 } | 139 } |
| 140 } | 140 } |
| 141 | 141 |
| 142 this.defaultActionButtonText_ = defaultText; | 142 this.defaultActionButtonText_ = defaultText; |
| 143 this.secondaryActionButtonText_ = secondaryText; | 143 this.secondaryActionButtonText_ = secondaryText; |
| 144 }, | 144 }, |
| 145 }); | 145 }); |
| OLD | NEW |