Ticket #22502: 22502.escape.diff
File 22502.escape.diff, 973 bytes (added by , 12 years ago) |
---|
-
wp-includes/js/media-views.js
1647 1647 tagName: 'div', 1648 1648 template: media.template('media-modal'), 1649 1649 1650 attributes: { 1651 tabindex: 0 1652 }, 1653 1650 1654 events: { 1651 'click .media-modal-backdrop, .media-modal-close' : 'closeHandler' 1655 'click .media-modal-backdrop, .media-modal-close': 'closeHandler', 1656 'keydown': 'keydown' 1652 1657 }, 1653 1658 1654 1659 initialize: function() { … … 1689 1694 }, 1690 1695 1691 1696 open: function() { 1692 this.$el.show() ;1697 this.$el.show().focus(); 1693 1698 return this.propagate('open'); 1694 1699 }, 1695 1700 … … 1722 1727 this.controller.trigger( id ); 1723 1728 1724 1729 return this; 1730 }, 1731 1732 keydown: function( event ) { 1733 // Close the modal when escape is pressed. 1734 if ( 27 === event.which ) { 1735 event.preventDefault(); 1736 this.close(); 1737 return; 1738 } 1725 1739 } 1726 1740 }); 1727 1741