This is a very common Twitter Bootstrap behavior using the data-toggle="dropdown".
To avoid this, the most simplest trick is - attach a click event handler on the internal dropdown menu and simply add event.stopPropagation(). Like so.
// The event won't be propagated up to the document NODE and
// therefore delegated events won't be fired
and obviously for that you need to also add the class that i mentioned above to the internal dropdown menus. For example: