Skip to content

Commit

Permalink
Revised icons.png/.svg mechanism
Browse files Browse the repository at this point in the history
  • Loading branch information
mfg92 committed May 4, 2020
1 parent f6eb114 commit 6947a1e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 7 additions & 1 deletion static/shortcode-gallery/swipebox/css/swipebox.css
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ html.swipebox-html.swipebox-touch {
#swipebox-prev,
#swipebox-next,
#swipebox-close {
background-image: url(../img/icons.svg);
background-image: url(../img/icons.png);
background-repeat: no-repeat;
border: none !important;
text-decoration: none !important;
Expand All @@ -151,6 +151,12 @@ html.swipebox-html.swipebox-touch {
top: 0;
}

.useSvg #swipebox-prev,
.useSvg #swipebox-next,
.useSvg #swipebox-close{
background-image: url(../img/icons.svg);
}

#swipebox-arrows {
display: block;
margin: 0 auto;
Expand Down
9 changes: 3 additions & 6 deletions static/shortcode-gallery/swipebox/js/jquery.swipebox.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,9 @@

$( 'body' ).append( html );

if ( !supportSVG || plugin.settings.useSVG === false ) {
bg = $( '#swipebox-close' ).css( 'background-image' );
bg = bg.replace( 'svg', 'png' );
$( '#swipebox-prev, #swipebox-next, #swipebox-close' ).css( {
'background-image' : bg
} );
if ( supportSVG && plugin.settings.useSVG === true ) {
$( '#swipebox-overlay' ).addClass("useSvg");
}
}

if ( isMobile ){
Expand Down

0 comments on commit 6947a1e

Please sign in to comment.