fix($ionicPopup): make it work if jquery is included

Closes #1027