nobitagit / ng-material-floating-button

Material design floating menu with action buttons implemented as an Angularjs directive.
http://nobitagit.github.io/ng-material-floating-button/
MIT License
464 stars 130 forks source link

Close when clicking away #78

Closed FilmCoder closed 7 years ago

FilmCoder commented 7 years ago

Hi,

Is it possible to make it so that if you click to open it, then click somewhere else on the screen, the button collapses? Right now it stays open, even if you click away. Thanks!

nobitagit commented 7 years ago

I left this feature out on purpose as I did not want to touch the window object and just deal as much as I could only with the namespace that this component creates.

Anyway it should be quite easy to do with custom code or some external third party script (see here). Once you listen to that event just close the menu programmatically, as shown in docs.

Cheers.