Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 19 additions & 9 deletions src/object-row.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,19 +176,29 @@ class ObjectRow extends React.Component {
}
if (this.props.actionsOpen && !this.props.object.disabled) {
let actions = []
for (let actionId = 0; actionId < this.props.actions.length; actionId++) {
let action = this.props.actions[actionId]
this.props.actions.map((action, index) => {
let actionEnabled = action.enabled
let tooltip
if (!(actionEnabled === undefined)) {
if (typeof actionEnabled === 'function') actionEnabled = actionEnabled(this.props.object)
if (Array.isArray(actionEnabled)) {
[actionEnabled, tooltip] = actionEnabled
}
} else {
actionEnabled = true
}
actions.push(
<li
key={'action-' + actionId}
className="action"
onClick={this.onActionClick}
data-action={actionId}
>
key={'action-' + index}
title={tooltip}
className={classNames({'disabled': !actionEnabled}, 'action')}
onClick={actionEnabled ? this.onActionClick : null}
data-action={index}
>
{action.label}
</li>
)
}
)
})
cells.push(
<td
key="actions"
Expand Down
7 changes: 7 additions & 0 deletions src/object-table.sass
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@ div.object-table-container
&:hover
background: $selection-colour
color: #fff
&.disabled
cursor: not-allowed
color: $border-colour
&:hover
background: #fff
color: $border-colour


td.uneditable
background: #fafafa
Expand Down