Skip to content
This repository has been archived by the owner on May 7, 2021. It is now read-only.

Commit

Permalink
fix(treelist): Added styling to mimic dnd mockup
Browse files Browse the repository at this point in the history
Modified styling to mimic mockups at: https://redhat.invisionapp.com/share/YV9U2DO2R#/screens/212276939.
Default drop slot height can be overridden via planner using:
.node-drop-slot.is-dragging-over {height: 66px;}
  • Loading branch information
dlabrecq authored and joshuawilson committed Mar 23, 2017
1 parent 0f66252 commit 4ab5227
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 11 deletions.
32 changes: 24 additions & 8 deletions src/app/treelist/treelist-item.component.scss
Original file line number Diff line number Diff line change
@@ -1,16 +1,32 @@
@import "../../assets/stylesheets/_base";

.list-group-item {
border: none;
cursor: pointer;
padding-left: 0;
&:hover {
background-color: $color-pf-black-200;
.tree-list {
.list-group-item {
border: none;
&:first-child {
border: none;
}
}
&.tree-item-selected {
background-color: $color-pf-blue-100;
}

.node-content-wrapper {
.list-group-item {
border: none;
cursor: pointer;
padding-left: 0;
&:hover {
background-color: $color-pf-black-200;
}
&.tree-item-selected {
background-color: $color-pf-blue-100;
&:hover {
background-color: $color-pf-blue-100;
}
}
}
&.is-dragging-over {
.list-group-item {
background-color: $color-pf-black-400;
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/app/treelist/treelist.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
(click)="node.mouseAction('click', $event)"
(dblclick)="node.mouseAction('dblClick', $event)"
(contextmenu)="node.mouseAction('contextMenu', $event)"
(dragstart)="handleDragStart($event)"
(treeDrop)="node.onDrop($event)"
[treeAllowDrop]="node.allowDrop.bind(node)"
[treeDrag]="node"
Expand Down
11 changes: 9 additions & 2 deletions src/app/treelist/treelist.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,23 @@
.node-drop-slot {
height: 4px;
}
*/
.node-drop-slot.is-dragging-over {
height: 60px;
background-color: $color-pf-black-400;
border: none;
//height: 66px;
}
*/

.node-content-wrapper {
display: inherit;
padding: 0;
border-radius: inherit;
transition: none;
&.is-dragging-over {
background-color: $color-pf-black-400;
border: none;
box-shadow: none;
}
}

.node-wrapper {
Expand Down
7 changes: 6 additions & 1 deletion src/app/treelist/treelist.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,12 @@ export class TreeListComponent implements OnInit {
ngOnInit(): void {
}

// Events
// Drag effect: https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API
handleDragStart($event: any) {
$event.dataTransfer.effectAllowed = "copyMove";
}

// Tree events

handleEvent($event: any): void {
this.onEvent.emit($event);
Expand Down

0 comments on commit 4ab5227

Please sign in to comment.