|
|
|
@ -368,39 +368,63 @@ const FilmStrip = { |
|
|
|
|
|
|
|
|
|
return new Promise(resolve => { |
|
|
|
|
let thumbs = this.getThumbs(!forceUpdate); |
|
|
|
|
if(thumbs.localThumb) |
|
|
|
|
thumbs.localThumb.animate({ |
|
|
|
|
height: local.thumbHeight, |
|
|
|
|
width: local.thumbWidth |
|
|
|
|
}, { |
|
|
|
|
queue: false, |
|
|
|
|
duration: animate ? 500 : 0, |
|
|
|
|
complete: resolve |
|
|
|
|
}); |
|
|
|
|
if(thumbs.remoteThumbs) |
|
|
|
|
thumbs.remoteThumbs.animate({ |
|
|
|
|
height: remote.thumbHeight, |
|
|
|
|
width: remote.thumbWidth |
|
|
|
|
}, { |
|
|
|
|
queue: false, |
|
|
|
|
duration: animate ? 500 : 0, |
|
|
|
|
complete: resolve |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
this.filmStrip.animate({ |
|
|
|
|
// adds 2 px because of small video 1px border
|
|
|
|
|
height: remote.thumbHeight + 2 |
|
|
|
|
}, { |
|
|
|
|
queue: false, |
|
|
|
|
duration: animate ? 500 : 0 |
|
|
|
|
}); |
|
|
|
|
let promises = []; |
|
|
|
|
|
|
|
|
|
if(thumbs.localThumb) { |
|
|
|
|
promises.push(new Promise((resolve) => { |
|
|
|
|
thumbs.localThumb.animate({ |
|
|
|
|
height: local.thumbHeight, |
|
|
|
|
width: local.thumbWidth |
|
|
|
|
}, this._getAnimateOptions(animate, resolve)); |
|
|
|
|
})); |
|
|
|
|
} |
|
|
|
|
if(thumbs.remoteThumbs) { |
|
|
|
|
promises.push(new Promise((resolve) => { |
|
|
|
|
thumbs.remoteThumbs.animate({ |
|
|
|
|
height: remote.thumbHeight, |
|
|
|
|
width: remote.thumbWidth |
|
|
|
|
}, this._getAnimateOptions(animate, resolve)); |
|
|
|
|
})); |
|
|
|
|
} |
|
|
|
|
promises.push(new Promise((resolve) => { |
|
|
|
|
this.filmStrip.animate({ |
|
|
|
|
// adds 2 px because of small video 1px border
|
|
|
|
|
height: remote.thumbHeight + 2 |
|
|
|
|
}, this._getAnimateOptions(animate, resolve)); |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
promises.push(new Promise(() => { |
|
|
|
|
let { localThumb } = this.getThumbs(); |
|
|
|
|
let height = localThumb.height(); |
|
|
|
|
let fontSize = UIUtil.getIndicatorFontSize(height); |
|
|
|
|
this.filmStrip.find('.indicator').animate({ |
|
|
|
|
fontSize |
|
|
|
|
}, this._getAnimateOptions(animate, resolve)); |
|
|
|
|
})); |
|
|
|
|
|
|
|
|
|
if (!animate) { |
|
|
|
|
resolve(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Promise.all(promises).then(resolve); |
|
|
|
|
}); |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Helper method. Returns options for jQuery animation |
|
|
|
|
* @param animate {Boolean} - animation flag |
|
|
|
|
* @param cb {Function} - complete callback |
|
|
|
|
* @returns {Object} - animation options object |
|
|
|
|
* @private |
|
|
|
|
*/ |
|
|
|
|
_getAnimateOptions(animate, cb = $.noop) { |
|
|
|
|
return { |
|
|
|
|
queue: false, |
|
|
|
|
duration: animate ? 500 : 0, |
|
|
|
|
complete: cb |
|
|
|
|
}; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns thumbnails of the filmstrip |
|
|
|
|
* @param only_visible |
|
|
|
|