Skip to content

Commit

Permalink
fix: #3 undo broken with data-full-string on AppDynamics exJM.
Browse files Browse the repository at this point in the history
  • Loading branch information
svrnm committed Jul 15, 2021
1 parent 1e3b016 commit a4abd37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 0 additions & 2 deletions src/commands/ReplaceImage.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ class ReplaceImage extends Command {
search = parameters[0]
}

console.log(search, replace, withRatio)

this.search = search
this.replace = replace
this.withRatio = withRatio === '1' || withRatio === 'true'
Expand Down
2 changes: 2 additions & 0 deletions src/models/Monkey.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,10 +228,12 @@ class Monkey {
configuration.apply(pseudoNode, 'value', 'text')
if (node.dataset.fullString !== pseudoNode.value) {
const original = node.textContent
const originalFullString = node.dataset.fullString
const replacement = original.length < pseudoNode.value.length ? '...' + pseudoNode.value.substring(pseudoNode.value.length - original.length - 3) : pseudoNode.value
node.dataset.fullString = pseudoNode.value
node.textContent = replacement
undos.push(new UndoElement(node, 'textContent', original, node.textContent))
undos.push(new UndoElement(node.dataset, 'fullString', originalFullString, node.dataset.fullString))
}
})
this.addUndo(undos)
Expand Down

0 comments on commit a4abd37

Please sign in to comment.