Skip to content

Commit bcbee9d

Browse files
committed
Bug fix: duplicate video embed icons in testquestion2
IM-870
1 parent de7f67f commit bcbee9d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

javascript/general.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -650,6 +650,7 @@ function recclick(type,typeid,info,txt) {
650650
}
651651
}
652652
function setuptracklinks(i,el) {
653+
jQuery(el).addClass("trackprepped");
653654
if (jQuery(el).attr("data-base")) {
654655
jQuery(el).click(function(e) {
655656
var inf = jQuery(this).attr('data-base').split('-');
@@ -756,6 +757,7 @@ function setupvideoembeds(i,el) {
756757
tabindex: 0,
757758
"class": "videoembedbtn"
758759
}).insertAfter(el);
760+
jQuery(el).addClass("prepped");
759761
videoembedcounter++;
760762
}
761763

@@ -1038,9 +1040,9 @@ function initlinkmarkup(base) {
10381040
if (typeof isImathasAssessment != 'undefined') {
10391041
$(base).find('a:not([target])').not('.textsegment a, .mce-content-body a').each(addBlankTarget);
10401042
}
1041-
$(base).find('a').each(setuptracklinks).each(addNoopener);
1042-
$(base).find('a[href*="youtu"]').not('.textsegment a,.mce-content-body a').each(setupvideoembeds);
1043-
$(base).find('a[href*="vimeo"]').not('.textsegment a,.mce-content-body a').each(setupvideoembeds);
1043+
$(base).find('a').not('.trackprepped').each(setuptracklinks).each(addNoopener);
1044+
$(base).find('a[href*="youtu"]').not('.textsegment a,.mce-content-body a,.prepped').each(setupvideoembeds);
1045+
$(base).find('a[href*="vimeo"]').not('.textsegment a,.mce-content-body a,.prepped').each(setupvideoembeds);
10441046
$(base).find("a.attach").not('.textsegment a,.mce-content-body a').not(".prepped").each(setuppreviewembeds);
10451047
setupToggler(base);
10461048
setupToggler2(base);

0 commit comments

Comments
 (0)