Supervisor requires bootstrap modal with drag-and-drop movement effect. The code is as follows:
Js
1 //bootstrap modal frame window move extension, called after Bootstrap initialization2 varBtmodalmoveex =function () {3 functionMoveex ($ This) {4 var$head = $ This. Find (". Modal-header"), $dialog = $ This. Find (". Modal-dialog");5 varmove = {ismove:false, left:0, top:0};6$ This. On ("MouseMove",function(e) {7 if(!move.ismove)return;8$dialog. Offset ({top:e.pagey-move.top, Left:e.pagex-move.left});9}). On ("MouseUp",function () {TenMove.ismove =false; One }); A$head. On ("MouseDown",function(e) { -Move.ismove =true; - varoffset =$dialog. Offset (); theMove.left = E.pagex-Offset.left; -Move.top = E.pagey-Offset.top; - }); - } + - varOld =$.fn.modal; +$.fn.modal =function(o, _r) { A var$ This= $( This); at //identifies if a move event has been bound. To prevent duplicate binding - if(!$ This. attr ("ISBINDMV")){ -$ This. attr ("ISBINDMV", "1"); -Moveex ($ This); - } - returnOld.call ( This, O, _r); in }; -};
CSS
{ cursor: move;}
How to use
$ (' #editModal '). Modal ({backdrop: ' static '});
Bootstrap modal modal frame drag-and-drop extension