summaryrefslogtreecommitdiffstats
path: root/app/common
diff options
context:
space:
mode:
authorYoshie Muranaka <yoshiemuranaka@gmail.com>2019-11-11 10:27:06 -0800
committerGunnar Mills <gmills@us.ibm.com>2019-11-14 01:48:14 +0000
commit432f02cd8355509a8a51fe2baf2097de78a831bf (patch)
tree2c0858ee5f10f9e6e92a7189a4bd1833ff47eeac /app/common
parentc10fce5b9497eea5ff36160adf0497c62b53a549 (diff)
downloadphosphor-webui-432f02cd8355509a8a51fe2baf2097de78a831bf.tar.gz
phosphor-webui-432f02cd8355509a8a51fe2baf2097de78a831bf.zip
Fix table-actions error
When using the table component with table actions enabled, if an icon file name isn't provided, the action type should display in the table. This will fix the webpack error when compiling the table component without an icon to display by changing the ng-if directive to check for falsy values instead of just 'null' to also catch 'undefined' values. Signed-off-by: Yoshie Muranaka <yoshiemuranaka@gmail.com> Change-Id: I72daeb035e4e5f0391953f9f2ae042d0b9fc2b99
Diffstat (limited to 'app/common')
-rw-r--r--app/common/components/table/table-actions.js7
1 files changed, 2 insertions, 5 deletions
diff --git a/app/common/components/table/table-actions.js b/app/common/components/table/table-actions.js
index d76d5e5..34b3f46 100644
--- a/app/common/components/table/table-actions.js
+++ b/app/common/components/table/table-actions.js
@@ -38,9 +38,6 @@ window.angular && (function(angular) {
if (action.type === undefined) {
return;
}
- if (action.file === undefined) {
- action.file = null;
- }
if (action.enabled === undefined) {
action.enabled = true;
}
@@ -76,8 +73,8 @@ window.angular && (function(angular) {
ng-repeat="action in $ctrl.actions track by $index"
ng-disabled="!action.enabled"
ng-click="$ctrl.onClick(action.type)">
- <icon ng-if="action.file !== null" ng-file="{{action.file}}"></icon>
- <span ng-if="action.file === null">{{action.type}}</span>
+ <icon ng-if="action.file" ng-file="{{action.file}}"></icon>
+ <span ng-if="!action.file">{{action.type}}</span>
</button>`
/**
OpenPOWER on IntegriCloud