I was trying to avoid to the user close the modal window using the esc key so i did this:

Drupal.behaviors.modalExample = function(context) {
  Drupal.modalFrame.open({
    url: Drupal.settings.basePath + 'my/menu/path/',
    width: 500, 
    height: 350,
    draggable: false,
    customDialogOptions: { 
      closeOnEscape: false
    }
  });
  return false;
}

But that doesn't work, after to reviewing the code seems to the "esc" key event is handle by the plugin and not by the jQuery Dialog.

So, i created a patch where before to close the child window review the jQuery Dialog option and if exists and is set as false then avoid to close the child window.

CommentFileSizeAuthor
onclose_error-1.patch1.17 KBgnuget

Comments

bwinett’s picture

Status: Needs review » Reviewed & tested by the community

Works perfectly - thanks!

dsnopek’s picture

Issue summary: View changes
Status: Reviewed & tested by the community » Fixed

Tested and committed in 48617a1. It works great, thanks!

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.