angular-filemanager icon indicating copy to clipboard operation
angular-filemanager copied to clipboard

Could this work without jQuery?

Open iJungleboy opened this issue 10 years ago • 13 comments

I'm the core architect of 2sxc (https://github.com/2sic/2sxc) which is an extension to DNN (a popular .net CMS). I'm considering using the angular-filemanager, as everything we did in 2sxc is now based on angular and it seems a good fit. One of my concerns in jQuery - I've been working hard to avoid using jQuery in our solution and have so far been very successful - but as I see your filemanager seems to need it. Do you think it's really necessary or might not the built in angular-features suffice? What do you think?

iJungleboy avatar Nov 30 '15 14:11 iJungleboy

Hi @iJungleboy I'm very interested to remove jQuery of my project.. The uses of jQuery are for:

  • Handle bootstrap modals $('element').modal()
  • Build preview images/files URL with $.param()
  • Handle context-menu focusing on nested items app.js:24

We can work together to make it work without jQuery?

joni2back avatar Nov 30 '15 14:11 joni2back

I believe all this could be done without jQuery - and it would probably be faster, and certainly cleaner (as jQuery tends to promote a unique dev-style :).

  1. for the rare dom-selector it should work well with if(angular) { ...angular.element(...) }
  2. bootstrap modal works easily without it - we use it a lot in 2sxc though we do use https://angular-ui.github.io/bootstrap/ so maybe that's a new dependency for this?
  3. this one may be tricky, as it's one of the things I call the unique dev-style of jQuery. This would probably be better if reworked a bit...

iJungleboy avatar Nov 30 '15 15:11 iJungleboy

Exactly!!, or handle modals with raw js to prevent the angular-boostrap module... I'm on vacations this weeks, could you try to make this changes in a fork to propose a PR ? Thanks!!!

joni2back avatar Nov 30 '15 17:11 joni2back

I'll see what I can do but am pretty swamped w/2sxc for now. Hope to get to it but can't promise.

iJungleboy avatar Dec 02 '15 11:12 iJungleboy

I'm reviewing the code and can't actually run it on a normal windows / Visual-Studio environment. This means I would have to spend quite a lot of time just to get it to work - before I could start trying to remove jQuery. Can't prioritize this for now :(

iJungleboy avatar Dec 07 '15 22:12 iJungleboy

:+1:

durasj avatar Feb 24 '16 18:02 durasj

:+1:

v-lukes avatar Mar 29 '16 20:03 v-lukes

:+1:

generalconsensus avatar Apr 07 '16 04:04 generalconsensus

Hands on that!

Anyone can help me to translate this jquery selector to native?

$(window.document).on(
    'contextmenu', 
    '.main-navigation .table-files tr.item-list:has("td"), .item-list', 
    function(){...}
)

joni2back avatar Apr 07 '16 05:04 joni2back

If I understand what you want to do, here is how: https://plainjs.com/javascript/events/live-binding-event-handlers-14/ ... plainjs.com is really great if you want to do something in raw js and don't want to spend hours searching

durasj avatar Apr 07 '16 10:04 durasj

Is the intention to still allow the use of Angular's built in jQuery (jqLite) or go completely native?

Nevario avatar Aug 02 '16 01:08 Nevario

@NetbearSoftware I tried to move to angular bootstrap but I don't like how it interact with the dom... But this is to take into account.. I'll very appreciate a contribution with this ticket

joni2back avatar Aug 02 '16 02:08 joni2back

@joni2back can try using angular approach like https://github.com/Wildhoney/ngContextMenu

davistan avatar Jan 19 '17 11:01 davistan