Skip to content

Commit

Permalink
Add relative path to image src
Browse files Browse the repository at this point in the history
Issue: #188
Problem: When element is added the absolute path is set
Solution: Set the relative path

Signed-off-by: Kornelia Kobiela <k.kobiela@samsung.com>
  • Loading branch information
Kornelia Kobiela committed Sep 11, 2019
1 parent 890c85c commit d92a304
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions design-editor/src/utils/attribute-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,7 @@ export default {
if (event.target.readyState === FileReader.DONE) {
const
filePath = path.join('images', file.name),
writePath = pathUtils.createProjectPath(filePath),
readPath = pathUtils.createProjectPath(filePath, true);
writePath = pathUtils.createProjectPath(filePath);

utils.checkGlobalContext('writeFile') (
writePath,
Expand All @@ -36,16 +35,16 @@ export default {
getDEModel.updateAttribute(
elementId,
changedAttribute,
readPath
filePath
);
} else {
getDEModel.updateStyle(
elementId,
changedAttribute,
`url("${readPath}")`
`url("${filePath}")`
);
}
changeImageInfo(readPath);
changeImageInfo(filePath);
}
);
}
Expand Down

0 comments on commit d92a304

Please sign in to comment.