Skip to content

Commit

Permalink
#3 Support move down
Browse files Browse the repository at this point in the history
  • Loading branch information
edwingamboa committed May 23, 2019
1 parent e1e0712 commit f496304
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/cubx_injector_sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
actionBtn: 'btn btn-sm btn-light',
editBtn: 'fas fa-pen',
removeBtn: 'fas fa-trash',
moveUpBtn: 'fas fa-arrow-up',
moveDownBtn: 'fas fa-arrow-down',
moveUpBtn: 'fas fa-arrow-up action-up',
moveDownBtn: 'fas fa-arrow-down action-down',
hidden: 'hidden',
actionsContainer: 'actions-container btn-group',
};
Expand Down Expand Up @@ -278,7 +278,10 @@
{
label: ACTIONS_LABELS.moveDown,
listener: function () {
console.log('Moving down');
if (row.nextSibling !== null) {
let tbody = row.parentNode;
tbody.insertBefore(row.nextSibling, row);
}
},
className: ELEMENTS_CLASSES.actionBtn,
iconClassName: ELEMENTS_CLASSES.moveDownBtn
Expand Down

0 comments on commit f496304

Please sign in to comment.