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:
parent
d018152785
commit
dc73f008ce
|
@ -6549,12 +6549,13 @@
|
||||||
* @returns {HTMLElement}
|
* @returns {HTMLElement}
|
||||||
*/
|
*/
|
||||||
prepareSrc : function (media) {
|
prepareSrc : function (media) {
|
||||||
var t = (new Date()).getTime();
|
var i = wp.media.view.MediaDetails.instances++;
|
||||||
_.each( $(media).find('source'), function (source) {
|
_.each( $(media).find('source'), function (source) {
|
||||||
source.src = [
|
source.src = [
|
||||||
source.src,
|
source.src,
|
||||||
source.src.indexOf('?') > -1 ? '&' : '?',
|
source.src.indexOf('?') > -1 ? '&' : '?',
|
||||||
t
|
'_=',
|
||||||
|
i
|
||||||
].join('');
|
].join('');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -6673,6 +6674,8 @@
|
||||||
resetFocus: function() {
|
resetFocus: function() {
|
||||||
this.$( '.embed-media-settings' ).scrollTop( 0 );
|
this.$( '.embed-media-settings' ).scrollTop( 0 );
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
instances : 0
|
||||||
});
|
});
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue