ngx-bootstrap icon indicating copy to clipboard operation
ngx-bootstrap copied to clipboard

Is the modal draggable?

Open chinra02 opened this issue 9 years ago • 11 comments

Hi,

Could you please add draggable support to modal to move around.

Thanks

chinra02 avatar May 25 '17 20:05 chinra02

Hi! This feature isn't a part of original bootstrap modal so we won't include this functionality to the package. Although you can use this lib https://www.npmjs.com/package/angular2-draggable (just apply ngDraggable directive on .modal-dialog and there you go)

IlyaSurmay avatar Jun 23 '17 13:06 IlyaSurmay

Thanks for the update. I will try using angular2-draggable

chinra02 avatar Jun 23 '17 14:06 chinra02

Hi! Thanks for the package :) Anyhow, i have a little problem with the modal. Every time I drag it, move it, dissmis it and then opening it again, it opens and the position where it was moved. Is there anyway how the window can "pop up" at the center of the screen, even if I have moved it before? Thanks!

zuzhal avatar Aug 06 '17 18:08 zuzhal

@IlyaSurmay do you have an elegant way to do this? Because i'm using modal service, and I can't access the outer modal.

andrea-spotsoftware avatar Oct 13 '17 11:10 andrea-spotsoftware

Is there a way to handle persistence that @zuzhal is referring to?

cmark11 avatar Apr 07 '18 04:04 cmark11

@cmark11 https://github.com/xieziyu/angular2-draggable/issues/30

ctrl-brk avatar Apr 07 '18 06:04 ctrl-brk

I wrote a simple library mattxu-zz/ngb-modal-draggable to make ng-bootstrap modal draggable. maybe you could try it.

mattxu-zz avatar Oct 26 '18 08:10 mattxu-zz

@IlyaSurmay do you have an elegant way to do this? Because i'm using modal service, and I can't access the outer modal.

@IlyaSurmay @andrea-spotsoftware I have same problem. Using Angular2Dragable(ngDraggable directive). Any solution? Thanks.

volkanokcu avatar Nov 07 '18 14:11 volkanokcu

I am using jquery ui to make modals draggable.

https://stackoverflow.com/a/53843281/6559330

pasadyaguy avatar Dec 20 '18 01:12 pasadyaguy

Simple directive (based on the ngx-modal-draggable library mentioned above) to make an ngx-bootstrap modal draggable: https://gist.github.com/markleusink/7af171d5f17e7dc9714e69965fdabab9

markleusink avatar Apr 11 '19 09:04 markleusink

a solution for that is to use :

import { AngularDraggableModule } from 'angular2-draggable'; in your app.module .

in your angular's styles.css put :

`.modal-content > .ng-draggable { background-color: #fff; }

.backgroundTransparent .modal-content { background: transparent !important; }

.modal-content { background: transparent !important; border: none; }`

in your html put a <div ngDraggable> inside your modal's ng-template :

yasstec avatar Jan 16 '20 09:01 yasstec