Skip to content

Commit

Permalink
Merge branch 'feature/draggable' of https://github.com/darkomtc11/ngx…
Browse files Browse the repository at this point in the history
…-smart-modal into darkomtc11-feature/draggable
  • Loading branch information
Maxime Lafarie committed Jan 28, 2020
2 parents 52a7d60 + 75dda4e commit cb9e413
Show file tree
Hide file tree
Showing 7 changed files with 11,113 additions and 10,718 deletions.
41 changes: 11 additions & 30 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions src/app/demo/main/main.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ <h1 class="title">ngx-smart-modal</h1>
style="position:absolute;top: 300px;left: 900px;">Custom target modal</button>
<button class="button -regular"
(click)="goNewDynamic()">Create dynamic modal<span>new</span></button>
<button class="button -regular"
(click)="draggableModal.open()">Draggable modal<span>new</span></button>
</div>

<h3 class="title">Examples with CSS frameworks</h3>
Expand Down Expand Up @@ -343,3 +345,26 @@ <h1>Hey, I am a modal placed relatively to an element!</h1>
<button class="button -dark"
(click)="customTarget.close()">Close</button>
</ngx-smart-modal>

<ngx-smart-modal #draggableModal
[draggable]="true"
[draggableEdges]="true"
identifier="draggableModal">
<h1>Hey, you can drag me anywhere by holding my edges or handle!</h1>
<p>Add class ".draggable" to any element inside modal to make it a drag handle.</p><br>
<span class="draggable">Handle</span>
<span>Not handle</span>
<br><br>
<button class="button -regular" (click)="secondDraggableModal.open()">Second draggable
modal<span>new</span></button>
</ngx-smart-modal>

<ngx-smart-modal #secondDraggableModal
[draggable]="true"
identifier="secondDraggableModal">
<h1>Hey, I will move independently from my parent!</h1>
<p>I can only be moved by a handle.</p><br>
<span class="draggable">Handle</span>
<span>Not handle</span>
<br><br>
</ngx-smart-modal>
8 changes: 8 additions & 0 deletions src/app/demo/main/main.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,11 @@
}
}
}

span.draggable {
color: white;
padding: 5px;
text-align: center;
background-color: gray;
margin-right: 10px;
}
Loading

0 comments on commit cb9e413

Please sign in to comment.