Don't use jQuerry anymore #67
Labels
No labels
blocked
bug
duplicate
enhancement
FR accepted
help wanted
invalid
need discussion
next release
not reproduced
PR requested
question
reproduced
WFB
WIP
wontfix
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Blocks
#66 [BUG] Unknown call to setInterval
deblan/side_menu
Reference
deblan/side_menu#67
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I'd like to point out this message of nextcloud:
I recommend moving away from jQuery entirely. It's way too overblown for a menu and there are better methodes these days.
And a menu should be as lightwight as possible.
If you need help with moving certain functionality away from jQuery, feel free to tell, and I'll see whether I can help.
Best regards,
some random Dev who hated jQuery from the first day and hence hasn't used it in any project ;)
No seriously, I never liked it, one reason I moved from web to backend stuff.
jQuery in used by/included in Nextcloud, that's why I use it too. I will replace jQuery code by vanilla JS but I need time :)
Work in progress on feature/removing-jquery
99% of jquery has been removed (excepted admin.js).
Do you know how to replace https://gitnet.fr/deblan/side_menu/src/branch/feature/removing-jquery/templates/js/_topMenuApps.js#L139-L140 with vanilla js?
admin.jsis now refactored.Still 3 calls to jquery:
jQuery(menu).undelegate('li:not(#more-apps) > a', 'click')jQuery(navigation).undelegate('a', 'click')jQuery("#categories-list .side-menu-setting-list").sortable({Regarding _topMenuApp.js L139 and L140:
Would it be okay to remove all eventListeners (or all 'click' eventListeners) of the element? – Then I'd have a solution. Otherwise, I'd be unsure, how to recieve the EventListener reference. But I can try some stuff over the weekend.
Regarding c53221d112/src/admin.js (L179):
We might have to use a library like html5sortable or SortableJS
Both weight about 2kB gzipped, hence much smaller than jquery. A tradeoff we can do, I suppose.
html5sortableincluded!All 'click' event listeners must be removed to override the click behaviour that show the loaders.
Released in v2.0.0 excepted delegate/undelegate!