Skip to content

Commit

Permalink
feat: add support for centered image
Browse files Browse the repository at this point in the history
  • Loading branch information
wazelin committed Jul 31, 2024
1 parent 34e7e66 commit 3bc617b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
10 changes: 5 additions & 5 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@oat-sa/tao-core-libs": "^1.0.0",
"@oat-sa/tao-core-sdk": "^3.0.0",
"@oat-sa/tao-core-shared-libs": "^1.4.1",
"@oat-sa/tao-core-ui": "^3.1.0",
"@oat-sa/tao-core-ui": "github:oat-sa/tao-core-ui-fe#feature/AUT-3769/support-centered-image",
"@oat-sa/tao-item-runner": "^1.0.0",
"@oat-sa/tao-qunit-testrunner": "^2.0.0",
"async": "^0.2.10",
Expand Down
3 changes: 2 additions & 1 deletion src/qtiCommonRenderer/renderers/Figure.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import _ from 'lodash';
import containerHelper from 'taoQtiItem/qtiCommonRenderer/helpers/container';
import imageTpl from 'taoQtiItem/qtiCommonRenderer/tpl/figure-image';
import widgetTpl from 'taoQtiItem/qtiCommonRenderer/tpl/figure-widget';
import { FLOAT_LEFT_CLASS, FLOAT_RIGHT_CLASS, CENTER_CLASS } from 'ui/mediaEditor/plugins/mediaAlignment/helper';

const DISABLE_FIGURE_WIDGET = context.featureFlags['FEATURE_FLAG_DISABLE_FIGURE_WIDGET'];

Expand All @@ -33,7 +34,7 @@ export default {
}

let showFigure = false;
if (data.attributes.class && ['wrap-left', 'wrap-right'].includes(data.attributes.class)) {
if (data.attributes.class && [FLOAT_LEFT_CLASS, FLOAT_RIGHT_CLASS, CENTER_CLASS].includes(data.attributes.class)) {
showFigure = true;
} else {
_.some(elem.bdy['elements'], childElement => {
Expand Down

0 comments on commit 3bc617b

Please sign in to comment.