#2493 closed Defect (fixed)
Avatar menu missing in riverdashboard when using ajax selector for all, friends, mine
| Reported by: | Gillie | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | Elgg 1.7.4 |
| Component: | River Dashboard | Version: | 1.7 |
| Severity: | annoying | Keywords: | |
| Cc: | brettp, ewinslow | Difficulty: |
Description
The arrow and avatar dropdown menu dissapear from user icons when switching between all, following, mine in the riverdashboard.
Regards gillie
Change History (4)
comment:1 Changed 3 years ago by cash
- Summary changed from Avatar menu missing in dashboard to Avatar menu missing in riverdashboard when using ajax selector for all, friends, mine
comment:2 Changed 3 years ago by cash
- Cc ewinslow added; dave removed
comment:3 Changed 3 years ago by brettp
- Resolution set to fixed
- Status changed from new to closed
(In [svn:7008]) Fixes #2493: Added optional parent argument to profile's setup_avatar_menu(). Added JS in riverdashboard to rebuild the avatar menu when loading sections via ajax.
comment:4 Changed 3 years ago by cash
(In [svn:7108]) Refs #2493 - merged [svn:7008] into trunk from 1.7 branch
Note: See
TracTickets for help on using
tickets.

I think Evan is better equipped than me to handle this one.
The issue is that the setup_avatar_menu() function is run on document ready. When the ajax returns the new html for the page after selecting "friends", setup_avatar_menu() is not called.
Our JavaScript guy has also overridden the default profile javascript for setup_avatar_menu() by adding a parent parameter. He may have done that so setup_avatar_menu is only run on one section of the page when called in an ajax callback.
His function starts out like this:
function setup_avatar_menu(parent) { if (!parent) { parent = document; } // avatar image menu link $(parent).find("div.usericon img").mouseover(function() { ...The only other change he made was
// avatar contextual menu $(parent).find(".avatar_menu_button img").click(function(e) {instead of
// avatar contextual menu $(".avatar_menu_button img").click(function(e) {