Modal Windows in Service Portal Drag and Move

ramesh_r
Mega Sage

I created the popup widget using the below code but i want the popup window should be drag and move feature

https://serviceportal.io/modal-windows-service-portal/

Please guide me what code i need to use

 

 

function($uibModal, $scope) {
 var c = this;
 
 c.openModal = function() {
 c.modalInstance = $uibModal.open({
 templateUrl: 'modalTemplate',
 scope: $scope
 });
 }
 
 c.closeModal = function() {
 c.modalInstance.close();
 }
 
}

 

 

 

<div>
 <button class="btn btn-primary" ng-click="c.openModal()">${Open Modal}</button>
</div>
 
<script type="text/ng-template" id="modalTemplate">
 <div class="panel panel-default">
 <div class="panel-heading">
 <h4 class="panel-title">Modal Window</h4>
   </div>
 <div class="panel-body wrapper-xl">
 Hello
   </div>
 <div class="panel-footer text-right">
 <button class="btn btn-primary" ng-click="c.closeModal()">${Close Modal}</button>
 </div>
 </div>
</script>

 

 

1 REPLY 1

Peter Bodelier
Giga Sage

Hi @ramesh_r,

 

I'm not completely sure this will work, but try adding this script in your link script:

$timeout(function () {
  $(".modal-content").draggable();
}, 10);

Help others to find a correct solution by marking the appropriate response as accepted solution and helpful.