Patching thumbnail bug

This commit is contained in:
James Barnsley
2018-11-12 16:27:53 +13:00
parent f5291a9786
commit 190ab95737
4 changed files with 2 additions and 56 deletions

View File

@ -5585,33 +5585,6 @@ var Thumbnail = function (_React$Component) {
return _possibleConstructorReturn(this, (Thumbnail.__proto__ || Object.getPrototypeOf(Thumbnail)).call(this, props));
}
/*
// TODO: ascertain whether this is improving or hindering performance
// The UI appears to work perfectly fine without this
shouldComponentUpdate(nextProps, nextState){
// no images at all, and we already know it
if (!nextProps.image && !this.props.image && !nextProps.images && !this.props.images) return false
// image changed
if (!this.props.image && nextProps.image) return true
if (this.props.image && nextProps.image) return true
if (this.props.image != nextProps.image) return true
// images array changed
if (this.props.images === undefined && nextProps.images ) return true
if (this.props.images && nextProps.images === undefined) return true
if (this.props.images && !nextProps.images || this.props.images.length != nextProps.images.length ) return true
// image item changed
var size = 'medium'
var images = helpers.sizedImages(nextProps.images )
if (this.props.size ) size = this.props.size
if (this.props.images[size] != images[size]) return true
return false
}
*/
_createClass(Thumbnail, [{
key: 'mapImageSizes',

File diff suppressed because one or more lines are too long

View File

@ -98,7 +98,7 @@
// Release details
// These are automatically injected to built HTML
var build = "1541971218";
var build = "1541974041";
var version = "3.30.0";
// Construct the script tag

View File

@ -14,33 +14,6 @@ class Thumbnail extends React.Component{
constructor(props){
super(props);
}
/*
// TODO: ascertain whether this is improving or hindering performance
// The UI appears to work perfectly fine without this
shouldComponentUpdate(nextProps, nextState){
// no images at all, and we already know it
if (!nextProps.image && !this.props.image && !nextProps.images && !this.props.images) return false
// image changed
if (!this.props.image && nextProps.image) return true
if (this.props.image && nextProps.image) return true
if (this.props.image != nextProps.image) return true
// images array changed
if (this.props.images === undefined && nextProps.images ) return true
if (this.props.images && nextProps.images === undefined) return true
if (this.props.images && !nextProps.images || this.props.images.length != nextProps.images.length ) return true
// image item changed
var size = 'medium'
var images = helpers.sizedImages(nextProps.images )
if (this.props.size ) size = this.props.size
if (this.props.images[size] != images[size]) return true
return false
}
*/
mapImageSizes(){