jquery.ui.dialog.patch.js 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * @file
  3. * This is part of a patch to address a jQueryUI bug. The bug is responsible
  4. * for the inability to scroll a page when a modal dialog is active. If the content
  5. * of the dialog extends beyond the bottom of the viewport, the user is only able
  6. * to scroll with a mousewheel or up/down keyboard keys.
  7. *
  8. * @see http://bugs.jqueryui.com/ticket/4671
  9. * @see https://bugs.webkit.org/show_bug.cgi?id=19033
  10. * @see views_ui.module
  11. * @see js/jquery.ui.dialog.min.js
  12. *
  13. * This JavaScript patch overwrites the $.ui.dialog.overlay.events object to remove
  14. * the mousedown, mouseup and click events from the list of events that are bound
  15. * in $.ui.dialog.overlay.create
  16. *
  17. * The original code for this object:
  18. * $.ui.dialog.overlay.events: $.map('focus,mousedown,mouseup,keydown,keypress,click'.split(','),
  19. * function(event) {
  20. * return event + '.dialog-overlay';
  21. * }).join(' '),
  22. */
  23. (function ($, undefined) {
  24. if ($.ui && $.ui.dialog && $.ui.dialog.overlay) {
  25. $.ui.dialog.overlay.events = $.map('focus,keydown,keypress'.split(','),
  26. function(event) {
  27. return event + '.dialog-overlay';
  28. }).join(' ');
  29. }
  30. }(jQuery));