Skip to content

Commit

Permalink
Plugin: TopLinks: Don't change icon when changing visibility - refs B…
Browse files Browse the repository at this point in the history
…T#19464
  • Loading branch information
AngelFQC committed Jan 19, 2022
1 parent 1f2b918 commit 28f6d37
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
14 changes: 12 additions & 2 deletions main/course_home/course_home.php
Expand Up @@ -103,7 +103,12 @@ function buttonForAllShowHide()
//eyes
$("#linktool_"+item.id).attr("class", item.fclass);
//tool
$("#toolimage_" + item.id).attr("src", item.image);
var $toolImage = $("#toolimage_" + item.id);
if (!$toolImage.data("forced-src")) {
$toolImage.attr("src", item.image);
}
//class
$("#tooldesc_" + item.id).attr("class", item.tclass);
$("#istooldesc_" + item.id).attr("class", item.tclass);
Expand Down Expand Up @@ -165,7 +170,12 @@ function buttonForAllShowHide()
$("#linktool_"+my_tool_id).attr("title", info.label);
//tool
$("#toolimage_" + my_tool_id).attr("src", new_current_tool_image);
var $toolImage = $("#toolimage_" + my_tool_id);
if (!$toolImage.data("forced-src")) {
$toolImage.attr("src", new_current_tool_image);
}
//clase
$("#tooldesc_" + my_tool_id).attr("class", info.tclass);
$("#istooldesc_" + my_tool_id).attr("class", info.tclass);
Expand Down
2 changes: 1 addition & 1 deletion plugin/toplinks/index.php
Expand Up @@ -34,7 +34,7 @@
var $toolImg = $toolA.find('img#toolimage_' + iconTool.id);

if (iconTool.img) {
$toolImg.prop('src', iconTool.img);
$toolImg.prop('src', iconTool.img).data('forced-src', iconTool.img);
}

var $block = $toolA.parents('.course-tool').parent();
Expand Down

0 comments on commit 28f6d37

Please sign in to comment.