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

RESOLVED FIXED in 2015-04-07

Status

Marketplace
Code Quality
P3
normal
RESOLVED FIXED
3 years ago
3 years ago

People

(Reporter: cvan, Assigned: ngoke)

Tracking

2015-04-07
Points:
---

Details

(Whiteboard: [qa-], URL)

(Reporter)

Description

3 years ago
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
(Reporter)

Comment 1

3 years ago
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
(Reporter)

Comment 2

3 years ago
PR: https://github.com/mozilla/fireplace/pull/845
Assignee: nobody → cvan
Target Milestone: --- → 2014-12-16

Updated

3 years ago
Blocks: 1141687

Updated

3 years ago
No longer blocks: 1059002

Updated

3 years ago
Blocks: 1148114
No longer blocks: 1141687
(Assignee)

Comment 3

3 years ago
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
Last Resolved: 3 years ago
Resolution: --- → FIXED
Target Milestone: 2014-12-16 → 2015-04-07

Comment 4

3 years ago
Can you please add some STRs to be executed in the new mkt-nav for this bug or mark this as qa-?
(Assignee)

Updated

3 years ago
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.