Thread

Inconsistent Element object in FluidField.on

November 24, 2017 7:10am

Subscribe [2]
  • #1 / Nov 24, 2017 7:10am

    Reinos

    74 posts

    I just notice that in the event FluidField.on('field_type', 'add') the element is a jQuery object and in the other events a DOM element.

    I would be better to make it or a jQuery object or a DOM element, but not mixed… I suggest a jQuery object grin

  • #2 / Nov 27, 2017 3:16pm

    Seth Barber's avatar

    Seth Barber

    168 posts

    I’m looking at the code and every FluidField triggered event should be passing a jQuery object. I’m not seeing a mismatch anywhere. Can you elaborate on what you are seeing?

  • #3 / Nov 29, 2017 2:40pm

    Reinos

    74 posts

    Hi Seth,

    I console.log the element in the events: https://www.dropbox.com/s/ytc7lis1pbe1ab2/fluid.png?dl=0

    Doing a .find() on a element; add succeed and the rest failed Uncaught TypeError: element.find is not a function

  • #4 / Nov 30, 2017 4:34pm

    Seth Barber's avatar

    Seth Barber

    168 posts

    Ah. It looks like the sorting events are not returning jQuery objects. On line 72 and 82 of themes/ee/asset/javascript/src/fields/fluid_field/cp.js can you change them to be FluidField.fireEvent($(ui.item).data('field-type'), 'beforeSort', $(ui.item)) and FluidField.fireEvent($(ui.item).data('field-type'), 'afterSort', $(ui.item)) respectively and let me know if that resolves it for you?

  • #5 / Dec 04, 2017 1:55pm

    Reinos

    74 posts

    Yes thanks!

ExpressionEngine News

#eecms, #events, #releases