Index: lams_central/web/css/authoring-svg.css =================================================================== diff -u -rbd1d96662a6c18c9c55bed0873563d086420668e -r2004cd28f4e47531a37d161b113806665a3aa345 --- lams_central/web/css/authoring-svg.css (.../authoring-svg.css) (revision bd1d96662a6c18c9c55bed0873563d086420668e) +++ lams_central/web/css/authoring-svg.css (.../authoring-svg.css) (revision 2004cd28f4e47531a37d161b113806665a3aa345) @@ -54,8 +54,14 @@ font-family : sans-serif; } -.svg-tool-activity-title-label.svg-tool-activity-title-label-middle { - text-anchor : middle; +.svg-tool-activity-title-box { + height: 100%; + display: flex; + flex-direction: column; + justify-content: center; + word-wrap: break-word; + padding-right: 2px; + text-align: center; } .svg-tool-activity-title-label.svg-tool-activity-title-label-small { Index: lams_central/web/includes/javascript/authoring/authoringActivity.js =================================================================== diff -u -rb0f329cc8232c804dc0db5d0898bb1ff9419ddc6 -r2004cd28f4e47531a37d161b113806665a3aa345 --- lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision b0f329cc8232c804dc0db5d0898bb1ff9419ddc6) +++ lams_central/web/includes/javascript/authoring/authoringActivity.js (.../authoringActivity.js) (revision 2004cd28f4e47531a37d161b113806665a3aa345) @@ -505,7 +505,7 @@ .addClass('svg-tool-activity-border'), // check for icon in the library icon = ActivityLib.getActivityIcon('grouping'), - label = ActivityLib.wrapActivityTitle(this.title, x, y); + label = ActivityLib.getActivityTitle(this.title, x, y); icon.select('svg').attr({ 'x' : x + 20, @@ -703,7 +703,7 @@ .addClass('svg-tool-activity-background ' + (this.grouping ? '' : 'svg-shadow')), shapeBorder = paper.path(shapePath) .addClass('svg-tool-activity-border' + (this.requireGrouping ? '-require-grouping' : '')), - label = ActivityLib.wrapActivityTitle(this.title, x, y), + label = ActivityLib.getActivityTitle(this.title, x, y), icon = ActivityLib.getActivityIcon(this.learningLibraryID); bannerPath += ' h ' + bannerWidth + ' v ' + height + ' z'; @@ -1857,17 +1857,7 @@ GeneralLib.setModified(true); }, - /** - * Reduce length of activity's title so it fits in its SVG shape. - */ - shortenActivityTitle : function(title) { - if (title.length > 23) { - title = title.substring(0, 22) + '...'; - } - return title; - }, - /** * Crawles through branches setting their lengths and finding the longest one. */ @@ -1901,18 +1891,18 @@ branchingActivity.longestBranchLength = longestBranchLength; }, - wrapActivityTitle : function(title, x, y) { - if (title.length < 15) { - var label = paper.text(x + 135, y + 45, title) - label.addClass('svg-tool-activity-title-label svg-tool-activity-title-label-middle'); - return label; - } + getActivityTitle : function(title, x, y) { - const firstLine = paper.text(x + 75, y + 35, title.substring(0, 13)) - secondLine = paper.text(x + 75, y + 55, title.length > 24 ? title.substring(13, 24) + '...' : title.substring(13, title.length)) - labelGroup = paper.g(firstLine, secondLine); - - labelGroup.addClass('svg-tool-activity-title-label'); - return labelGroup; + if (title.length > 35) { + title = title.substring(0, 35) + '...'; + } + var label = $('
').addClass('svg-tool-activity-title-label svg-tool-activity-title-box').text(title), + wrapper = $('