Don't use jQuerry anymore #67
Labels
No Label
bug
duplicate
enhancement
FR accepted
help wanted
invalid
need discussion
next release
not reproduced
PR requested
question
reproduced
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…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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.js
is now refactored.Still 3 calls to jquery:
c53221d112/templates/js/_topMenuApps.js (L139)
c53221d112/templates/js/_topMenuApps.js (L140)
c53221d112/src/admin.js (L179)
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.
html5sortable
included!All 'click' event listeners must be removed to override the click behaviour that show the loaders.
Released in v2.0.0 excepted delegate/undelegate!