From 12792afdde5fc88a41437c876f65f2f75b77b705 Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Fri, 14 Mar 2014 12:42:57 +0000 Subject: [PATCH] Make `media.view.VideoDetails.prepareSrc` a static class method instead of an instance method. Properly pairs it with its incrementing `instances` property. See #27389. git-svn-id: https://develop.svn.wordpress.org/trunk@27535 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/js/media-views.js | 46 +++++++++++++++---------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index fd65937794..03c746f8ee 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -6569,26 +6569,6 @@ }, this.options ); }, - /** - * When multiple players in the DOM contain the same src, things get weird. - * - * @param {HTMLElement} media - * @returns {HTMLElement} - */ - prepareSrc : function (media) { - var i = wp.media.view.MediaDetails.instances++; - _.each( $(media).find('source'), function (source) { - source.src = [ - source.src, - source.src.indexOf('?') > -1 ? '&' : '?', - '_=', - i - ].join(''); - }); - - return media; - }, - removeSetting : function (e) { var wrap = $( e.currentTarget ).parent(), setting; @@ -6702,7 +6682,27 @@ this.$( '.embed-media-settings' ).scrollTop( 0 ); } }, { - instances : 0 + instances : 0, + + /** + * When multiple players in the DOM contain the same src, things get weird. + * + * @param {HTMLElement} media + * @returns {HTMLElement} + */ + prepareSrc : function (media) { + var i = wp.media.view.MediaDetails.instances++; + _.each( $(media).find('source'), function (source) { + source.src = [ + source.src, + source.src.indexOf('?') > -1 ? '&' : '?', + '_=', + i + ].join(''); + }); + + return media; + } }); /** @@ -6727,7 +6727,7 @@ if ( audio.is(':hidden') ) { audio.show(); } - this.media = this.prepareSrc( audio.get(0) ); + this.media = media.view.MediaDetails.prepareSrc( audio.get(0) ); } else { audio.hide(); this.media = false; @@ -6761,7 +6761,7 @@ } if ( ! video.hasClass('youtube-video') ) { - this.media = this.prepareSrc( video.get(0) ); + this.media = media.view.MediaDetails.prepareSrc( video.get(0) ); } else { this.media = video.get(0); }