Projet

Général

Profil

Révision 0125e073

Ajouté par Assos Assos il y a plus de 6 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/media/js/media.browser.js
40 40
    });
41 41

  
42 42
    $('.media-browser-tab').each( Drupal.media.browser.validateButtons );
43

  
44
    // Keep keyboard focus from going to the browser chrome.
45
    $('body', context).once(function () {
46
      $(window).bind('keydown', function (event) {
47
        if (event.keyCode === 9) {
48
          var tabbables = $(':tabbable'),
49
              first = tabbables.filter(':first'),
50
              last = tabbables.filter(':last'),
51
              new_event;
52
          if ((event.target === last[0] && !event.shiftKey) || (event.target === first[0] && event.shiftKey)) {
53
            // If we're at the end of the tab list, then send a keyboard event
54
            // to the parent iframe.
55
            if (parent_iframe = Drupal.media.browser.getParentIframe(window)) {
56
              $('.ui-dialog-titlebar-close', $(parent_iframe).closest('.ui-dialog')).focus();
57
              event.preventDefault();
58
              return false;
59
            }
60
          }
61
        }
62
      });
63
    });
43 64
  }
44 65
  // Wait for additional params to be passed in.
45 66
};

Formats disponibles : Unified diff