Skip to content

Commit

Permalink
Fix script and template to show background image again after disablin…
Browse files Browse the repository at this point in the history
…g it
  • Loading branch information
coolcat-creations committed Oct 14, 2017
1 parent 4ead4ca commit f59cf38
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 5 additions & 1 deletion mod_ccctwoclick/media/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@

content[0].innerHTML = "";
content[0].appendChild( iframe );
content[0].style.background = null;
content[0].style.backgroundImage = null;
content[0].style.backgroundRepeat = null;
content[0].style.backgroundSize = null;

enablebtn[0].style.display = 'none';
Expand All @@ -55,6 +56,9 @@
disablebtn[0].style.display = 'none';
enablebtn[0].style.display = 'inline';
contentbefore[0].style.display = 'block';
content[0].style.backgroundImage = content[0].dataset.background;
content[0].style.backgroundRepeat = 'no-repeat';
content[0].style.backgroundSize = content[0].dataset.backgroundsize;

} );

Expand Down
4 changes: 2 additions & 2 deletions mod_ccctwoclick/tmpl/default.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@
<div class="ccctwoclickcontainer <?php echo $moduleclass_sfx; ?>" style="width:<?php echo $iwidth; ?>;">

<div class="ccctwoclick" data-source="<?php echo $isrc; ?>" data-width="<?php echo $iwidth; ?>"
data-height="<?php echo $iheight; ?>"
style="width:<?php echo $iwidth; ?>; height:<?php echo $iheight; ?>; <?php if ($disabledimage) : ?>background:url(<?php echo $disabledimage; ?>) no-repeat; background-size:<?php echo $backgroundsize; ?>;<?php endif; ?>">
data-height="<?php echo $iheight; ?>" data-background="url(<?php echo $disabledimage; ?>)" data-backgroundsize="<?php echo $backgroundsize; ?>"
style="width:<?php echo $iwidth; ?>; height:<?php echo $iheight; ?>; <?php if ($disabledimage) : ?>background-image:url(<?php echo $disabledimage; ?>); background-repeat:no-repeat; background-size:<?php echo $backgroundsize; ?>;<?php endif; ?>">
</div>

<div class="contentbefore">
Expand Down

0 comments on commit f59cf38

Please sign in to comment.