Skip to content

Commit

Permalink
Merge pull request #411 from oat-sa/feature/AUT-3769/align-center
Browse files Browse the repository at this point in the history
Feature AUT-3769 Support centering image
  • Loading branch information
wazelin authored Aug 2, 2024
2 parents 40b47fe + 6010bbb commit 81b5265
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
11 changes: 6 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": "^3.6.0",
"@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 81b5265

Please sign in to comment.