Skip to content

Commit

Permalink
Merge pull request #770 from turnitin/fix/close_rubrics
Browse files Browse the repository at this point in the history
fix closing rubrics modal from click by internal close btn
  • Loading branch information
andrii-ilin authored Oct 7, 2024
2 parents b96b33b + e4302d4 commit eb903d0
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
11 changes: 11 additions & 0 deletions jquery/turnitintooltwo-2024100901.js
Original file line number Diff line number Diff line change
Expand Up @@ -1218,8 +1218,19 @@
});
}

function handleCloseModalMessage(event) {
// Check if the message type is 'CloseRubricsView'
// Emits by TFS when the user closes the rubrics view.
if (event.data.type === 'CloseRubricsView') {
jQuery('#cboxClose').click();
window.removeEventListener('message', handleCloseModalMessage);
}
}

function lightBoxCloseButton() {
$('body').append('<div id="tii_close_bar"><a href="#" onclick="jQuery(\'#cboxClose\').click(); return false;">' + M.str.turnitintooltwo.closebutton + '</a></div>');

window.addEventListener("message", handleCloseModalMessage);
}

function initialiseDigitalReceipt() {
Expand Down
Loading

0 comments on commit eb903d0

Please sign in to comment.