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

Deliver user hover menus via Ajax (Trac #4495) #4495

Closed
elgg-gitbot opened this issue Feb 16, 2013 · 17 comments
Closed

Deliver user hover menus via Ajax (Trac #4495) #4495

elgg-gitbot opened this issue Feb 16, 2013 · 17 comments

Comments

@elgg-gitbot
Copy link

Original ticket http://trac.elgg.org/ticket/4495 on 42339840-09-07 by trac user mrclay, assigned to unknown.

Elgg version: Github Master

Numerous benefits:

  • faster server-side: fewer view renderings per pages, especially those with lots of users
  • faster client-side: probably 3/4 less markup delivered per user, most of which goes unneeded on the page
  • keeping user-specific hover items (add friend/admin options) out of the markup makes it easier to build caching around.
  • builds infrastructure for user operations that needn't require a page reload, like adding a friend. After I add a friend, their hover menu should change accordingly.

The nice thing is all the views exist to do this and probably wouldn't need alteration.

@elgg-gitbot
Copy link
Author

ewinslow wrote on 42340167-09-29

+1000

@elgg-gitbot
Copy link
Author

ewinslow wrote on 42340220-04-03

This should be relatively easy. Would be a good idea to measure the performance gain on various pages too.

@elgg-gitbot
Copy link
Author

Milestone changed to Near Term Future Release by ewinslow on 42340220-04-03

@elgg-gitbot
Copy link
Author

trac user mrclay wrote on 42340233-08-28

One consideration I didn't make explicit: accessibility w/o JS. I've not reviewed the current menu without JS, but CSS hover would not help if the markup wasn't there. The menu on the user profile page would have to substitute for this. is this a concern?

@elgg-gitbot
Copy link
Author

ewinslow wrote on 42340653-01-21

a11y and working without JavaScript are separate issues.

In this case I'm not concerned about the JavaScript part because you can just click through to the user's profile and do what you need to there.

@elgg-gitbot
Copy link
Author

trac user sembrestels wrote on 42544034-11-24

I like the idea too.

@mrclay
Copy link
Member

mrclay commented Mar 1, 2013

Just sticking this on the agenda for 1.9 with low priority. /cc @ewinslow @sembrestels

@ewinslow
Copy link
Contributor

ewinslow commented Mar 1, 2013

Whatever we do is going to change in 1.10, right? Are we interested in redoing this so shortly afterwards?

@cash
Copy link
Contributor

cash commented Mar 1, 2013

I think this should wait for 1.10

@mrclay
Copy link
Member

mrclay commented Mar 1, 2013

OK cool.

@Srokap
Copy link
Contributor

Srokap commented May 26, 2013

Just mentioning, that commenting out hover menus display on blog listing (10 items) gives me 27% - 39% speed improvement, so it's rather important feature. In general menus system (hover and entity menus) seems to be one of the heavier parts on xdebug.

@ewinslow
Copy link
Contributor

If that's true it sounds like an amazing performance improvement! Can't wait!

@jdalsem
Copy link
Member

jdalsem commented Aug 30, 2013

@mrclay
Copy link
Member

mrclay commented Sep 10, 2013

Did some cleanup on ColdTrick's plugin: ColdTrick/lazy_hover#3

@mrclay
Copy link
Member

mrclay commented Oct 31, 2013

FYI: when the menus arrive via XHR it might be helpful to fire a JS hook. ColdTrick/lazy_hover#7

@mrclay
Copy link
Member

mrclay commented Oct 31, 2013

Suggest:

  • embed data-menu-subject into the UL containing JSON with keys: guid, username, name.
  • trigger hook [render, ui.user_hover_menu] after each menu is established in the DOM. For Elgg today, this would mean after DOM ready, core would find all the hover menus and call the hook on each. With lazy hover, this would be fired when a single menu arrives by XHR.
  • the hook would be passed a reference to the UL as "menu"

@Srokap
Copy link
Contributor

Srokap commented Oct 31, 2013

SGTM

mrclay pushed a commit to mrclay/Elgg-leaf that referenced this issue Apr 10, 2015
mrclay pushed a commit to mrclay/Elgg-leaf that referenced this issue Apr 10, 2015
mrclay pushed a commit to mrclay/Elgg-leaf that referenced this issue Apr 11, 2015
mrclay pushed a commit to mrclay/Elgg-leaf that referenced this issue Apr 11, 2015
mrclay pushed a commit to mrclay/Elgg-leaf that referenced this issue Apr 11, 2015
@jdalsem jdalsem closed this as completed Apr 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

6 participants