Skip to content
This repository has been archived by the owner on Dec 15, 2022. It is now read-only.

Update status bar when image is reloaded #133

Merged
merged 6 commits into from Dec 28, 2018

Conversation

TimvdLippe
Copy link
Contributor

@TimvdLippe TimvdLippe commented Jul 6, 2017

Requirements

  • Filling out the template is required. Any pull request that does not include enough information to be reviewed in a timely manner may be closed at the maintainers' discretion.
  • All new code requires tests to ensure against regressions

Description of the Change

When an image is reloaded from disc, it assigns a new value to src with the current date, listens again for the on-load after the fact, to then fire an update. The status bar thus listens to this update and calculates the sizes again.

Alternate Designs

I am not aware of a different method to achieve this

Benefits

The status bar is updated again

Possible Drawbacks

I could not write a test for this. First of all, when I would copy displays the size of the image as is in the spec, it would throw TypeError: Cannot read property 'textContent' of null. For some reason there is state left over after the beforeEach, but I could not track down why.

Applicable Issues

Fixes #105

Not sure why this did not work before, but I later realized
the MutationObserver is not necessary at all
@50Wliu 50Wliu merged commit de2aa6a into atom:master Dec 28, 2018
@TimvdLippe TimvdLippe deleted the update-status-bar branch December 28, 2018 18:51
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Status bar not updated when image changes
2 participants