Base solution for your next web application
Open Closed

Draggable modal #910


User avatar
0
lauriep created

Is it possible to make modals draggable?

I have tried adding the 'draggable-modal' class to various <DIV> elements on the modal like this:

<div class="draggable-modal">
    <form name="userCreateOrEditLocationForm" role="form" novalidate class="form-validation">
        <div class="modal-header draggable-modal" style="background-color: #9eacb4; color:white">
            <h4 class="modal-title">
                <span>Edit Location</span>
            </h4>
        </div>
        <div class="modal-body">

And by passing in options in the JS call like this:

vm.editLocation = function () {
                var modalInstance = $modal.open({
                    templateUrl: '~/App/tenant/views/location/createOrEditLocationModal.cshtml',
                    controller: 'common.views.users.createOrEditLocationModal as vm',
                    windowTopClass: 'draggable-modal',
                    backdrop: 'static'//,

Any ideas please?


2 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You need to write a custom directive for that. Please see this plunkr <a class="postlink" href="http://plnkr.co/edit/cu1TVKCY8ucYcT2AScJb?p=preview">http://plnkr.co/edit/cu1TVKCY8ucYcT2AScJb?p=preview</a>

    I hope it helps.

  • User Avatar
    0
    lauriep created

    Okay, thanks for the info, I will have a look.