Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Timeline - remove onResize handler when destroying timeline #1523

Merged
merged 1 commit into from
Jan 30, 2019
Merged

Timeline - remove onResize handler when destroying timeline #1523

merged 1 commit into from
Jan 30, 2019

Conversation

himdel
Copy link
Contributor

@himdel himdel commented Jan 30, 2019

Fixes #1337

The timeline component listens for the resize event on window, and triggers a repaint of the timeline

But, it never removes that listener, even after moving to a screen without timeline,
causing a console error when opening the notification area (which generates a resize event).

Error: <rect> attribute width: A negative value is not valid. ("-250")
Error: <pattern> attribute width: A negative value is not valid. ("-250")
Error: <rect> attribute width: A negative value is not valid. ("-250")
Error: <rect> attribute width: A negative value is not valid. ("-250")

This fixes that, by removing the listener when the component is destroyed.

Cc @AllenBW , no more 1337 issues, w00t :)

Fixes #1337

The timeline component listens for the resize event on window, and triggers a repaint of the timeline

But, it never removes that listener, even after moving to a screen without timeline,
causing a console error when opening the notification area (which generates a resize event).

    Error: <rect> attribute width: A negative value is not valid. ("-250")
    Error: <pattern> attribute width: A negative value is not valid. ("-250")
    Error: <rect> attribute width: A negative value is not valid. ("-250")
    Error: <rect> attribute width: A negative value is not valid. ("-250")

This fixes that, by removing the listener when the component is destroyed.
@himdel
Copy link
Contributor Author

himdel commented Jan 30, 2019

Steps to reproduce:

Go to My Services
Visit a service with at least 1 VM
Click on the VM (to get to the detail screen, with timelines)
Go back to Dashboard
Open the Notifications area

Before: errors in js console
Now: no errors :)

@miq-bot
Copy link
Member

miq-bot commented Jan 30, 2019

Checked commit https://github.com/himdel/manageiq-ui-service/commit/5b2d58e6afdc2474df3103d9682e62b51477df15 with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0
0 files checked, 0 offenses detected
Everything looks fine. 🍪

@AllenBW AllenBW self-assigned this Jan 30, 2019
@AllenBW AllenBW added the bug label Jan 30, 2019
@AllenBW AllenBW added this to the Sprint 104 Ending Feb 4, 2019 milestone Jan 30, 2019
Copy link
Member

@AllenBW AllenBW left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CLEAN CONSOLE <3 <3 <3

@AllenBW AllenBW merged commit 4be9a49 into ManageIQ:master Jan 30, 2019
@himdel himdel deleted the 1337 branch January 30, 2019 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Errors when opening Notification area, after having visited timelines
3 participants