Convert project to webpack
This commit is contained in:
@@ -62,6 +62,7 @@
|
||||
sanitizeTitle: false
|
||||
, hasVideo: true
|
||||
, onMediaChange: (oMedia) => {}
|
||||
, onClosing: () => {}
|
||||
};
|
||||
|
||||
Lightbox.prototype.option = function(options) {
|
||||
@@ -477,6 +478,7 @@
|
||||
var $hasVideoNav = this.$container.hasClass('lb-video-nav');
|
||||
switch(self.album[imageNumber].type) {
|
||||
case 'video':
|
||||
self.$image.removeAttr('src');
|
||||
this.$video.on('loadedmetadata', function(){
|
||||
self.album[imageNumber].width = this.videoWidth;
|
||||
self.album[imageNumber].height = this.videoHeight;
|
||||
@@ -489,7 +491,7 @@
|
||||
if(!$hasVideoNav) this.$container.addClass('lb-video-nav');
|
||||
break;
|
||||
case 'image':
|
||||
this.$video.attr('src', '');
|
||||
this.$video.trigger('pause').removeAttr('src');
|
||||
if($hasVideoNav) this.$container.removeClass('lb-video-nav');
|
||||
|
||||
// When image to show is preloaded, we send the width and height to sizeContainer()
|
||||
@@ -718,11 +720,10 @@
|
||||
if(this.options.hasVideo) {
|
||||
var $lbContainer = this.$lightbox.find('.lb-container');
|
||||
var $hasVideoNav = $lbContainer.hasClass('lb-video-nav');
|
||||
this.$video.attr('src', '');
|
||||
this.$video.trigger('pause').removeAttr('src');
|
||||
|
||||
if($hasVideoNav) $lbContainer.removeClass('lb-video-nav');
|
||||
}
|
||||
oSpot.flushHash();
|
||||
|
||||
$(window).off('resize', this.sizeOverlay);
|
||||
this.$nav.off('mousewheel');
|
||||
@@ -732,6 +733,8 @@
|
||||
if (this.options.disableScrolling) {
|
||||
$('body').removeClass('lb-disable-scrolling');
|
||||
}
|
||||
|
||||
this.options.onClosing();
|
||||
};
|
||||
|
||||
return new Lightbox();
|
||||
|
||||
Reference in New Issue
Block a user