Ticket #22632: 22632.diff
| File 22632.diff, 1.6 KB (added by koopersmith, 7 months ago) |
|---|
-
wp-includes/js/media-views.js
1216 1216 media.view.MediaFrame.prototype[ method ] = function( view ) { 1217 1217 if ( this.modal ) 1218 1218 this.modal[ method ].apply( this.modal, arguments ); 1219 this.trigger( method );1220 1219 return this; 1221 1220 }; 1222 1221 }); … … 1657 1656 1658 1657 _.defaults( this.options, { 1659 1658 container: document.body, 1660 title: '' 1659 title: '', 1660 propogate: true 1661 1661 }); 1662 1662 }, 1663 1663 … … 1680 1680 1681 1681 attach: function() { 1682 1682 this.$el.appendTo( this.options.container ); 1683 this.trigger('attach'); 1684 return this; 1683 return this.propogate('attach'); 1685 1684 }, 1686 1685 1687 1686 detach: function() { 1688 1687 this.$el.detach(); 1689 this.trigger('detach'); 1690 return this; 1688 return this.propogate('detach'); 1691 1689 }, 1692 1690 1693 1691 open: function() { 1694 1692 this.$el.show(); 1695 this.trigger('open'); 1696 return this; 1693 return this.propogate('open'); 1697 1694 }, 1698 1695 1699 1696 close: function() { 1700 1697 this.$el.hide(); 1701 this.trigger('close'); 1702 return this; 1698 return this.propogate('close'); 1703 1699 }, 1704 1700 1705 1701 closeHandler: function( event ) { … … 1715 1711 // Set and render the content. 1716 1712 this.options.$content = ( $content instanceof Backbone.View ) ? $content.$el : $content; 1717 1713 return this.render(); 1714 }, 1715 1716 // Triggers a modal event and if the `propogate` option is set, 1717 // forwards events to the modal's controller. 1718 propogate: function( id ) { 1719 this.trigger( id ); 1720 1721 if ( this.options.propogate ) 1722 this.controller.trigger( id ); 1723 1724 return this; 1718 1725 } 1719 1726 }); 1720 1727