Issue #2380005 by eshta: Only initialize AJAX functions for dialogs that contain Drupal forms.
Merge branch 'Issue-2380005' into 7.x-1.x