Skip to content

Commit

Permalink
Merge pull request #2652 from oat-sa/hotfix/AUT-3890/multiple-hottext…
Browse files Browse the repository at this point in the history
…-when-disallowhtmlinhottext-enabled

fix: multiple hottext support when disallowHTMLInHottext is enabled
  • Loading branch information
viktar-dzmitryieu-tao authored Dec 20, 2024
2 parents 72b8918 + 7712463 commit b104b2c
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion views/js/loader/qtiLoader.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/js/loader/taoQtiItem.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/js/loader/taoQtiItem.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/js/loader/taoQtiItemRunner.es5.min.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion views/js/loader/taoQtiItemRunner.min.js.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions views/js/qtiCreator/widgets/helpers/selectionWrapper.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,10 @@ define(['jquery'], function ($) {
* @param {jQuery} $wrapper - the element that will wrap the selection
* @returns {boolean}
*/
wrapWith: function wrapWith($wrapper) {
const range = selection.getRangeAt(0);
wrapWith: function wrapWith($wrapper, providedRange) {
const range = providedRange || selection.getRangeAt(0);

if (this.canWrap()) {
if (this.canWrap(range)) {
try {
range.surroundContents($wrapper[0]);
selection.removeAllRanges();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ define([
} else {
if (
$cloneContent.text() === $cloneContent.html() &&
wrapper.wrapWith($newHottextClone)
wrapper.wrapWith($newHottextClone, range)
) {
await this.createNewHottext($newHottextClone);
} else {
Expand Down

0 comments on commit b104b2c

Please sign in to comment.