File tree Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Expand file tree Collapse file tree 2 files changed +22
-10
lines changed Original file line number Diff line number Diff line change 2020 afterClose : null ,
2121 loopAtEnd : false ,
2222 autoplayVideos : false ,
23- queryStringData : { }
23+ queryStringData : { } ,
24+ toggleClassOnLoad : ''
2425 } ,
2526
2627 plugin = this ,
791792 iframe = '<iframe width="560" height="315" src="' + url + '" frameborder="0" allowfullscreen></iframe>' ;
792793 }
793794
794- return '<div class="swipebox-video-container" style="max-width:' + plugin . settings . videomaxWidth + 'px"><div class="swipebox-video">' + iframe + '</div></div>' ;
795+ return '<div class="swipebox-video-container" style="max-width:' + plugin . settings . videoMaxWidth + 'px"><div class="swipebox-video">' + iframe + '</div></div>' ;
795796 } ,
796797
797798 /**
798799 * Load image
799800 */
800801 loadMedia : function ( src , callback ) {
801- if ( ! this . isVideo ( src ) ) {
802- var img = $ ( '<img>' ) . on ( 'load' , function ( ) {
803- callback . call ( img ) ;
804- } ) ;
805-
806- img . attr ( 'src' , src ) ;
807- }
802+ // Inline content
803+ if ( src . trim ( ) . indexOf ( '#' ) === 0 ) {
804+ callback . call (
805+ $ ( src )
806+ . clone ( )
807+ . toggleClass ( plugin . settings . toggleClassOnLoad )
808+ ) ;
809+ }
810+ // Everything else
811+ else {
812+ if ( ! this . isVideo ( src ) ) {
813+ var img = $ ( '<img>' ) . on ( 'load' , function ( ) {
814+ callback . call ( img ) ;
815+ } ) ;
816+
817+ img . attr ( 'src' , src ) ;
818+ }
819+ }
808820 } ,
809821
810822 /**
You can’t perform that action at this time.
0 commit comments