diff --git a/common/static/js/capa/drag_and_drop/scroller.js b/common/static/js/capa/drag_and_drop/scroller.js index 0a1fa48ea7..7a52c3c237 100644 --- a/common/static/js/capa/drag_and_drop/scroller.js +++ b/common/static/js/capa/drag_and_drop/scroller.js @@ -1,52 +1,33 @@ (function(requirejs, require, define) { - define([], function() { + define(['edx-ui-toolkit/js/utils/html-utils'], function(HtmlUtils) { return Scroller; function Scroller(state) { var $parentEl, $moveLeftEl, $showEl, $moveRightEl, showElLeftMargin; - $parentEl = $( - '
' - ); + $parentEl = $(HtmlUtils.HTML( + '
' + ).toString()); - $moveLeftEl = $( - '
' + - '
' + - '
' - ); + $moveLeftEl = $(HtmlUtils.joinHtml( + HtmlUtils.HTML('
'), + HtmlUtils.HTML('
'), + HtmlUtils.HTML('
'), + HtmlUtils.HTML('
') + ).toString()); $moveLeftEl.appendTo($parentEl); // The below is necessary to prevent the browser thinking that we want @@ -77,17 +58,9 @@ }); }); - $showEl = $( - '
' - ); + $showEl = $(HtmlUtils.HTML( + '
' + ).toString()); $showEl.appendTo($parentEl); showElLeftMargin = 0; @@ -96,53 +69,36 @@ // so that any SANE number of draggables will fit in a single row. It // will be contained in a parent element whose 'overflow' CSS value // will be hidden, preventing the long row from fully being visible. - state.sliderEl = $( - '
' - ); + // eslint-disable-next-line no-param-reassign + state.sliderEl = $(HtmlUtils.joinHtml( + HtmlUtils.HTML('
') + ).toString()); state.sliderEl.appendTo($showEl); state.sliderEl.mousedown(function(event) { event.preventDefault(); }); - $moveRightEl = $( - '
' + - '
' + - '
' - ); + $moveRightEl = $(HtmlUtils.joinHtml( + HtmlUtils.HTML('
'), + HtmlUtils.HTML('
'), + HtmlUtils.HTML('
'), + HtmlUtils.HTML('
') + ).toString()); $moveRightEl.appendTo($parentEl); // The below is necessary to prevent the browser thinking that we want