Add a class property to `wp.media.view.MediaDetails` called `instances` that is incremented every time the class is invoked. This mimics what happens in the shortcodes: the sources receive an incremented cache-buster so that the browser won't ignore the file when `preload="metadata"` is set.

See #26779.



git-svn-id: https://develop.svn.wordpress.org/trunk@27520 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Scott Taylor 2014-03-13 03:54:38 +00:00
parent d018152785
commit dc73f008ce
1 changed files with 5 additions and 2 deletions

View File

@ -6549,12 +6549,13 @@
* @returns {HTMLElement}
*/
prepareSrc : function (media) {
var t = (new Date()).getTime();
var i = wp.media.view.MediaDetails.instances++;
_.each( $(media).find('source'), function (source) {
source.src = [
source.src,
source.src.indexOf('?') > -1 ? '&' : '?',
t
'_=',
i
].join('');
});
@ -6673,6 +6674,8 @@
resetFocus: function() {
this.$( '.embed-media-settings' ).scrollTop( 0 );
}
}, {
instances : 0
});
/**