Skip to content

Commit

Permalink
remove: text decoration (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
sorenjohanson authored Nov 14, 2024
1 parent 9163619 commit b87f9bb
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 33 deletions.
1 change: 0 additions & 1 deletion teammapper-frontend/mmp/src/map/handlers/draw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,6 @@ export default class Draw {
div.style.setProperty('color', DOMPurify.sanitize(node.colors.name))
div.style.setProperty('font-style', DOMPurify.sanitize(node.font.style))
div.style.setProperty('font-weight', DOMPurify.sanitize(node.font.weight))
div.style.setProperty('text-decoration', DOMPurify.sanitize(node.font.decoration))

div.style.setProperty('touch-action', 'none')
div.style.setProperty('display', 'inline-block')
Expand Down
27 changes: 0 additions & 27 deletions teammapper-frontend/mmp/src/map/handlers/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,6 @@ export default class Nodes {
case 'fontWeight':
updated = this.updateNodeFontWeight(node, value)
break
case 'textDecoration':
updated = this.updateNodeTextDecoration(node, value)
break
case 'fontStyle':
updated = this.updateNodeFontStyle(node, value)
break
Expand Down Expand Up @@ -1025,29 +1022,6 @@ export default class Nodes {
}
}

/**
* Update the node text decoration.
* @param {Node} node
* @param {string} decoration
* @returns {boolean}
*/
private updateNodeTextDecoration = (node: Node, decoration: string): boolean => {
if (decoration && typeof decoration !== 'string') {
Log.error('The text decoration must be a string', 'type')
}

if (node.font.decoration !== decoration) {
node.getNameDOM().style['text-decoration'] = DOMPurify.sanitize(decoration)

this.map.draw.updateNodeShapes(node)

node.font.decoration = decoration
return true
} else {
return false
}
}

/**
* Update the node locked status.
* @param {Node} node
Expand Down Expand Up @@ -1140,7 +1114,6 @@ export const PropertyMapping = {
backgroundColor: ['colors', 'background'],
branchColor: ['colors', 'branch'],
fontWeight: ['font', 'weight'],
textDecoration: [],
fontStyle: ['font', 'style'],
fontSize: ['font', 'size'],
nameColor: ['colors', 'name'],
Expand Down
1 change: 0 additions & 1 deletion teammapper-frontend/mmp/src/map/models/node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,4 @@ export interface Font {
size: number
style: string
weight: string
decoration: string
}
6 changes: 2 additions & 4 deletions teammapper-frontend/mmp/src/map/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ export const DefaultNodeValues: DefaultNodeProperties = {
font: {
size: 16,
style: 'normal',
weight: 'normal',
decoration: ''
weight: 'normal'
},
locked: true,
detached: false,
Expand Down Expand Up @@ -233,8 +232,7 @@ export const DefaultRootNodeValues: DefaultNodeProperties = {
font: {
size: 20,
style: 'normal',
weight: 'normal',
decoration: ''
weight: 'normal'
},
locked: true,
detached: false,
Expand Down

0 comments on commit b87f9bb

Please sign in to comment.