Commit aa81cf5
committed
[PERF] web_editor: save original image size in element attributes
When computing the original size of the image, the original image is
loaded to make sure we get the right value.
This commit caches it into the `data-width` attribute of the image to
avoid loading the original image every time. This fixes the performance
penalty introduced in commit [1].
Because the attachment/original image could change between page reloads,
the `data-width` attribute is removed in `cleanForSave`.
[1]: 60e25f7
task-38474701 parent 1da99a2 commit aa81cf5
1 file changed
+18
-2
lines changedLines changed: 18 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6177 | 6177 | | |
6178 | 6178 | | |
6179 | 6179 | | |
| 6180 | + | |
| 6181 | + | |
| 6182 | + | |
| 6183 | + | |
| 6184 | + | |
| 6185 | + | |
| 6186 | + | |
6180 | 6187 | | |
6181 | 6188 | | |
6182 | 6189 | | |
| |||
6413 | 6420 | | |
6414 | 6421 | | |
6415 | 6422 | | |
| 6423 | + | |
| 6424 | + | |
| 6425 | + | |
| 6426 | + | |
6416 | 6427 | | |
6417 | 6428 | | |
6418 | 6429 | | |
| |||
6556 | 6567 | | |
6557 | 6568 | | |
6558 | 6569 | | |
6559 | | - | |
6560 | | - | |
| 6570 | + | |
| 6571 | + | |
| 6572 | + | |
| 6573 | + | |
| 6574 | + | |
| 6575 | + | |
| 6576 | + | |
6561 | 6577 | | |
6562 | 6578 | | |
6563 | 6579 | | |
| |||
0 commit comments