Closed Bug 1109448 Opened 10 years ago Closed 10 years ago

Remove redundant event listeners and function calls in `initNavbarButtons` for mobile navigation bar

Categories

(Marketplace Graveyard :: Code Quality, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED FIXED
2015-04-07

People

(Reporter: cvan, Assigned: kngo)

References

()

Details

(Whiteboard: [qa-])

This function https://github.com/mozilla/fireplace/blob/9c666dec/src/media/js/navbar.js#L25-L38 is called once on page load https://github.com/mozilla/fireplace/blob/9c666dec/src/media/js/navbar.js#L70 and every time the window is resized https://github.com/mozilla/fireplace/blob/9c666dec/src/media/js/navbar.js#L268 Related, the click event listeners are getting re-initialised every time the window is resized. Similarly, the listeners are getting called multiple times per click (exponentially) because the selector for the event listeners should be for the icons themselves (`.act-tray-mobile .icon` and `.mkt-tray-mobile .icon`), not the parent elements: https://github.com/mozilla/fireplace/blob/9c666dec/src/media/js/navbar.js#L41 https://github.com/mozilla/fireplace/blob/9c666dec/src/media/js/navbar.js#L53
Related: a `setTimeout` is being used, but a `transitionend` event listener should be used instead here: https://github.com/mozilla/fireplace/blob/9c666dec/src/media/js/navbar.js#L30-L37
Assignee: nobody → cvan
Target Milestone: --- → 2014-12-16
Blocks: 1141687
No longer blocks: 1059002
Blocks: 1148114
No longer blocks: 1141687
Will be fixed with the new Nav. Steps to See the Fix: 1. Go to Debug page. 2. Click Enable new mkt-nav
Assignee: cvan → kngo
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Target Milestone: 2014-12-16 → 2015-04-07
Can you please add some STRs to be executed in the new mkt-nav for this bug or mark this as qa-?
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.