Removed hardcoded dependency on JQuery when using a dropdown

Use angular.element() instead of JQuery() when closing the toggle. If JQuery is available angular.element will use the JQuery function otherwise it will use Angular's JQLite.