Skip to content

Commit

Permalink
Fix custom image option
Browse files Browse the repository at this point in the history
  • Loading branch information
kidclamp committed Nov 29, 2016
1 parent df1d53f commit d03cd83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Koha/Plugin/Com/ByWaterSolutions/CoverFlow.pm
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ sub configure {
print $template->output();
}
else {
$self->update_opacuserjs($mapping);
$self->update_opacuserjs($mapping, $custom_image);
$self->go_home();
}
}
Expand Down Expand Up @@ -270,6 +270,7 @@ sub update_opacuserjs {

my $template = $self->get_template( { file => 'opacuserjs.tt' } );
$template->param( 'mapping' => $mapping );
$template->param( 'custom_image' => $custom_image );

my $coverflow_js = $template->output();

Expand Down
2 changes: 1 addition & 1 deletion Koha/Plugin/Com/ByWaterSolutions/CoverFlow/opacuserjs.tt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ $(document).ready(function () {
$('[% m.selector %]').load("/coverflow.pl?id=[% m.id %]", function () {
$('.koha-coverflow img').on("load", function(){
if ( this.naturalHeight == 1 ) {
$(this).attr("src", [% IF (custom_image) %]"[% custom_image %][% ELSE %]"http://media.bywatersolutions.com/Model/NoImage.png")[% END%];
$(this).attr("src", [% IF (custom_image) %]"[% custom_image %]")[% ELSE %]"http://media.bywatersolutions.com/Model/NoImage.png")[% END%];
}
});
var opt = {
Expand Down

0 comments on commit d03cd83

Please sign in to comment.