I'm using draw plugin in my project and I would like to know how can I hide/show drawing tools by layer type?

For example, let's say I have 2 layers one of them type is Polygon and the other one is Line.

If user select **Polygon layer**, I want to **hide Line drawing tool**.

After that, If user select **Line layer**, I want to **hide Polygon drawing tool**. I've looked [here](http://leafletjs.com/2013/02/20/guest-post-draw.html) but this example is making tools static, I want to change *dynamically*. How can I do that?

Every suggestion will be appreciated.